What is the space complexity of the code that uses merge sort for determining the number of inversions in an array?

Q & ACategory: Data StructureWhat is the space complexity of the code that uses merge sort for determining the number of inversions in an array?
Admin Staff asked 4 years ago

What is the space complexity of the code that uses merge sort for determining the number of inversions in an array?
a) O(n)
b) O(log n)
c) O(1)
d) O(n log n)

1 Answers
Admin Staff answered 4 years ago

a) O(n)