Possible Duplicate:
Efficiently finding the ranks of elements in an array?
If I have an array of elements A [0 to 15], and I know that the median is in the range A[8..11]. How can I find the median of all the elements in A by picking it from A[8..11]? What will its rank be? I've been reading a lot about this but I couldn't find an answer to this specific question. Any help is appreciated. The array basically contains 2D points, and I want to split the points into rectangular regions.