The median of a set with an odd number of elements is the middle value if the data items are arranged in order.
An efficient algorithm to find the median that does not require first ordering the entire set can be obtained by modifying the quicksort algorithm. We use function s p1itO to position a pivot element.
If this pivot is positioned at location (n + 1)/2, it is the median; otherwise, one of the two subsists produced by sp1itO contains the median, and that subsist can be processed recursively.
Write a function to find the median of a list using this method.