##Stack vs heap##
Stack vs heap
I just wanted to comment on one thing. You have two functions, medianSmall()
and medianLarge()
, which are identical except that first allocates the array on the stack and the second allocates the array on the heap. There's no need for two functions. You should just use the one that allocates from the heap. There's no speed advantage to putting your array on the stack. The heap version is preferable because you don't have stack overflow problems that way.
##Stack vs heap##
I just wanted to comment on one thing. You have two functions, medianSmall()
and medianLarge()
, which are identical except that first allocates the array on the stack and the second allocates the array on the heap. There's no need for two functions. You should just use the one that allocates from the heap. There's no speed advantage to putting your array on the stack. The heap version is preferable because you don't have stack overflow problems that way.
Stack vs heap
I just wanted to comment on one thing. You have two functions, medianSmall()
and medianLarge()
, which are identical except that first allocates the array on the stack and the second allocates the array on the heap. There's no need for two functions. You should just use the one that allocates from the heap. There's no speed advantage to putting your array on the stack. The heap version is preferable because you don't have stack overflow problems that way.
##Stack vs heap##
I just wanted to comment on one thing. You have two functions, medianSmall()
and medianLarge()
, which are identical except that first allocates the array on the stack and the second allocates the array on the heap. There's no need for two functions. You should just use the one that allocates from the heap. There's no speed advantage to putting your array on the stack. The heap version is preferable because you don't have stack overflow problems that way.