The Gateway to Computer Science Excellence
+4 votes
2.1k views

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
in Algorithms by Veteran | 2.1k views

2 Answers

+10 votes
Best answer

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 .

by Boss
selected by
+6 votes

Answer : B 

Heap Sort and Merge Sort

      

by Boss
edited by
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,215 questions
60,024 answers
201,249 comments
94,710 users