• edited by
1,779 views
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?

  1. linear in $n$.
  2. $O\left(n^{2}\right)$ but not better.
  3. $O(n \log n)$.
  4. Same as heap sort.
  5. $O\left(n^{1.5}\right)$ but not better.

1 Answer

5 5 votes
B. It is same as selection sort. .
Position:
Show:

Related questions

1 1 vote
2 answers 2 answers
1.3k
1.3k views
Ravi Dubey asked Aug 2, 2018
1,307 views
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.
2 2 votes
1 answers 1 answer
2.4k
2.4k views
pankaj_vir asked Mar 19, 2018
2,360 views
Consider the following two statements:P: There exists a comparison sort of 5 numbers that uses at most 6 comparisons in worst case.Q: Heap sort can be used as the auxilia...
0 0 votes
2 2 answers
877
877 views
reena_kandari asked Jan 10, 2017
877 views
Consider the following two statementsP: There exists a comparison sort of 5 numbers that uses at most 6 comparisons in worst case.Q: Heap sort can be used as the auxiliar...
1 1 vote
1 answers 1 answer
1.1k
1.1k views
jenny101 asked Dec 9, 2016
1,135 views
Find the output after applying 2 passes of radix sort followed by 1 pass of bubble sort to the given integers: $120,231,417,343,542,998,675,196$. Tie is broken as per FIF...