Quickselect algorithm
18 8 3 2 1 5 4 9 10 Suppose we want to know the k-th element of the array, how we would do? We would sort the array, with O(nlogn) for example Then we will get the element searched But…
18 8 3 2 1 5 4 9 10 Suppose we want to know the k-th element of the array, how we would do? We would sort the array, with O(nlogn) for example Then we will get the element searched But…