I was wondering if it was possible to find the median value of an array? For example, suppose I have an array of size nine. Would it possible to find the middle slot of this array?
Assuming the array x is sorted and is of length n:
If n is odd then the median is x[(n-1)/2]. If n is even than the median is ( x[n/2] + x[(n/2)-1] ) / 2.
1.4m articles
1.4m replys
5 comments
56.9k users