Algorithms | Misc | Question 3

Which of the following is not an in-place algorithm?
(A) Insertion sort
(B) Selection sort
(C) Merge sort
(D) Heap sort

Answer: (C)

Explanation: An in-place algorithm is an algorithm which uses a constant amount of extra space apart from input.
Merge sort uses an extra O(n) space in the merging part.

My Personal Notes arrow_drop_up
Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.