What is the space complexity of a Merge Sort algorithm?
What is the space complexity of a Merge Sort algorithm?
Answer: B. O(n) — Merge Sort requires extra space for the auxiliary array, so its space complexity is O(n).
- A.
O(1)
- B.
O(n)
- C.
O(log n)
- D.
O(n log n)
Attempted by 526 students.
Show answer & explanation
Correct answer: B
Merge Sort requires extra space for the auxiliary array, so its space complexity is O(n).
Loading lesson…