Find kth element using randomized partition, it was proved to have linear average performance; it uses quicksort technique.