Data Structures & AlgorithmsHardWipro · Accenture pattern

Among insertion sort, merge sort, heap sort, quick sort, bubble sort and selection sort (standard array versions), how many are BOTH stable and in-place (O(1) extra space)?

  1. A. Four
  2. B. Three
  3. C. Two
  4. D. One

Correct answer: C. Two

Insertion sort and bubble sort are both. Merge sort is stable but needs O(n) extra space; heap sort and quick sort are in-place but not stable; selection sort's long-distance swap breaks stability.

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

Exams that ask this topic