ISRO Computer Science (CSE) 2014 - Question 62

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 2014

Consider the following sorting algorithms.\n1. Quicksort\n2. Heapsort\n3. Mergesort\nWhich of them perform in least time in the worst case?

  • A. 1 and 2 only
  • B. 2 and 3 only
  • C. 3 only
  • D. 1, 2 and 3

Answer: B. 2 and 3 only

Explanation: Worst case complexities:\nQuicksort: $O(n²)$.\nHeapsort: $O(n \log n)$.\nMergesort: $O(n \log n)$.\nHeapsort and Mergesort are faster in worst case.

| | All questions of ISRO Computer Science (CSE) 2014