What will be the auxiliary space complexity of the code to rotate an array by using the reversal algorithm

Q & ACategory: Data StructureWhat will be the auxiliary space complexity of the code to rotate an array by using the reversal algorithm
Admin Staff asked 4 years ago

What will be the auxiliary space complexity of the code to rotate an array by using the reversal algorithm (d = number of rotations)?
a) O(1)
b) O(n)
c) O(d)
d) O(n*d)

1 Answers
Admin Staff answered 4 years ago

a) O(1)