7,920 views
8 8 votes

Consider the following sorting algorithms.

  1. Quicksort
  2. Heapsort
  3. Mergesort

Which of them perform in least time in the worst case?

  1. I and II only
  2. II and III only
  3. III only
  4. I, II and III

2 Answers

Best answer
13 13 votes

Worst time complexity of Quicksort = O(n2)

Worst time complexity of Heapsort = O(nLogn)

Worst time complexity of Mergesort =O(nLogn)

Hence,Option(B) II and III .

• selected by
Answer:
Position:
Show:

Related questions

5 5 votes
1 answers 1 answer
7.3k
7.3k views
go_editor asked Jul 1, 2016
7,254 views
What is the time complexity for the following C module? Assume that $n>0$.int module(int n) { if (n == 1) return 1; else return (n + module(n-1)); }$O(n)$$O(\log n)$$O(n^...
15 15 votes
4 answers 4 answers
20.7k
20.7k views
ajit asked Sep 5, 2015
20,722 views
Suppose there are $11$ items in sorted order in an array. How many searches are required on the average, if binary search is employed and all searches are successful in f...
9 9 votes
6 6 answers
3.9k
3.9k views
Arjun asked Feb 27, 2025
3,948 views
Suppose that insertion sort is applied to the array $[1,3,5,7,9,11, x, 15,13]$ and it takes exactly two swaps to sort the array. Select all possible values of $x$.$10$$12...
5 5 votes
3 answers 3 answers
4.7k
4.7k views
go_editor asked Jul 1, 2016
4,734 views
Consider a 13 element hash table for which f(key)=key mod 13 is used with integer keys. Assuming linear probing is used for collision resolution, at which location would ...