0 0 votes 23. Suppose you are given $n$ numbers and you sort them in descending order as follows: First find the maximum. Remove this element from the list and find the maximum of the remaining elements, remove this element, and so on, until all elements are exhausted. How many comparisons does this method require in the worst case? linear in $n$. $O\left(n^{2}\right)$ but not better. $O(n \log n)$. Same as heap sort. $O\left(n^{1.5}\right)$ but not better. Algorithms sorting time-complexity test-series + – dhingrak 1.8k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
5 5 votes B. It is same as selection sort. . shree answered Dec 12, 2014 shree comment Share Follow See all 7 Comments 7 7 Comments reply Show 4 previous comments Arjun commented Aug 20, 2015 reply Follow flag If we see the statements step by step, it is doing selection sort. Of course it will be better if we can do a build heap- not sure from the question. 0 0 replyShare minal commented Aug 20, 2015 reply Follow flag haa then its better naa ,,,, 1 1 replyShare minal commented Aug 20, 2015 reply Follow flag ok arjun sir :) 0 0 replyShare Please log in or register to add a comment.