[algorithm] Finding the median of an unsorted array

Quickselect works in O(n), this is also used in the partition step of Quicksort.