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).

  1. A.

    O(1)

  2. B.

    O(n)

  3. C.

    O(log n)

  4. 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).

Explore the full course: Accenture Preparation

Loading lesson…