Example 5.2.2.3.Here we consider the problem of finding the kth smallest element of a given set of elements.The idea of the randomized algorithm for this problem is similar to RQS. Algorithm 5.2.2.4.RANDOM-SELECT(S,k) Input:S={a1,a2,...,an},nE IN,and a positive integer k<n. Step 1:if n =1 then return a1 else choose an i∈1,2,.n randomly. We can easily observe that,for every input (S,k),the worst case running time is (n2)(i.e.,there exists a sequence of random bits leading to e(n2) Output:the kth smallest element of S (i.e.,an ai such that sb<a=k-1)