median search Algorithm

There are O(n)-time (worst-case linear time) choice algorithms, and sublinear performance is possible for structured data; in the extreme, O(1) for an array of sorted data. In computer science, a choice algorithm is an algorithm for finding the kth smallest number in a list or array; such a number is named the kth order statistic.

median search source code, pseudocode and analysis