6,465 views
5 votes
5 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
10 votes
10 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:

Related questions

5 votes
5 votes
1 answer
1
go_editor asked Jul 1, 2016
4,869 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^...
14 votes
14 votes
4 answers
2
ajit asked Sep 5, 2015
12,765 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...
3 votes
3 votes
3 answers
3
go_editor asked Jul 1, 2016
3,247 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 ...
3 votes
3 votes
1 answer
4
go_editor asked Jul 1, 2016
3,656 views
A computing architecture, which allows the user to use computers from multiple administrative domains to reach a common goal is called asGrid ComputingNeutral NetworksPar...