Data Structures & AlgorithmsEasyTCS NQT · Infosys pattern

Which of these sorting algorithms is stable in its standard implementation?

  1. A. Quick sort
  2. B. Selection sort
  3. C. Heap sort
  4. D. Merge sort

Correct answer: D. Merge sort

Standard merge sort takes from the left half on ties, so equal keys keep their order. Quick sort, heap sort and selection sort can all swap equal keys past each other over long distances.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic