+1 vote
in Data Structures & Algorithms I by (110k points)
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 I

I have been asked this question in an international level competition.

1 Answer

+1 vote
by (408k points)
selected by
Best 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).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.