program to find the ith_smallest element. Expected run time is O(n).