|
|
|
|
|
by brown9-2
6135 days ago
|
|
k = n/2 is correct when you are dealing with zero-indexed arrays. For arrays whose length is even, I think it's also acceptable to take either one of the two values (instead of the mean of the two) as the median value. Wikipedia is fairly ambiguous on this as it only states "one often takes the mean" and "sometimes one takes the average of the two median numbers". I believe that for a large enough sample size the discrepancy shouldn't even matter all that much. |
|