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.
Recommended Posts:
- Algorithms | Misc | Question 11
- Algorithms | Misc | Question 16
- Algorithms | Misc | Question 12
- Algorithms | Misc | Question 13
- Algorithms | Misc | Question 14
- Algorithms | Misc | Question 15
- Algorithms | Misc | Question 10
- Algorithms | Misc | Question 11
- Algorithms | Misc | Question 8
- Algorithms | Misc | Question 5
- Algorithms | Misc | Question 9
- Algorithms | Misc | Question 6
- Algorithms | Misc | Question 7
- Algorithms | Misc | Question 13
- Algorithms | Misc | Question 11
- C | Misc | Question 7
- C | Misc | Question 1
- C | Misc | Question 6
- C | Misc | Question 2
- C | Misc | Question 7

