Selects kth element from unsorted list in O(n)