assume that perhaps the luxury of sorting before performing the search cannot be afforded is it possible to find the ith-smallest element without having to sort the list in the first placerandomized selection in the previous we examined the quick sort algorithm the quick sort algorithm allows us to sort an unordered list of items but has way of preserving the index of elements as the sorting algorithm runs generally speakingthe quick sort algorithm does the following selects pivot partitions the unsorted list around the pivot recursively sorts the two halves of the partitioned list using step and step one interesting and important fact is that after every partitioning stepthe index of the pivot will not change even after the list has become sorted it is this property that enables us to be able to work with not-so-fully sorted list to obtain the ith-smallest number because randomized selection is based on the quick sort algorithmit is generally referred to as quick select quick select the quick select algorithm is used to obtain the ith-smallest element in an unordered list of itemsin this casenumbers we declare the main method of the algorithm as followsdef quick_select(array_listleftrightk)split partition(array_listleftrightif split =kreturn array_list[splitelif split kreturn quick_select(array_listsplit rightkelsereturn quick_select(array_listleftsplit-