1.

What is the time complexity of the juggling algorithm to rotate an array?(a) O(1)(b) O(n)(c) O(d)(d) O(n*d)My query is from Arrays Types in portion Arrays Types of Data Structures & Algorithms II have been asked this question in an international level competition.

Answer»

The CORRECT answer is (b) O(n)

Easy explanation - TIME complexity of JUGGLING ALGORITHM is O(n). Its auxiliary space complexity is O(1).



Discussion

No Comment Found

Related InterviewSolutions