corrected some typos in the comments
O(n) median finding algorithm. Finds ith smallest