The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+3 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
asked in Algorithms by Veteran (97.7k points) | 1.6k views

2 Answers

+9 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 .

answered by Boss (40.9k points)
selected by
+6 votes

Answer : B 

Heap Sort and Merge Sort


answered by Boss (45.1k points)
edited by

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
49,814 questions
54,522 answers
75,385 users