Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Find median of [2, 5, 2, 6, 7, 3, 7, 5, 7, 0, 6, 10]

Ok, I'm encountering this weird result when performing:

l = [2, 5, 2, 6, 7, 3, 7, 5, 7, 0, 6, 10]
r = median(l)

The r becomes 11/2 which is 5.5. The median here is clearly an integer and it is 5!

Why does it return 5.5?