0

My teacher has just teach me about complexity of algorithm and he has gave me some homework. I have solve almost all except for this ex:
Consider a robot arm that is fixed at one end. The arm contains two elbows at each of which it is possible to rotate the arm 90 degrees up and down in a vertical plane. How would you mathematically model the possible movements of the end of the arm? Describe an algorithm to move the end of the robot arm from one permissible position to another.
I have to make an algorithm from this requirement? Please give me some cue. ==

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by tungnk1993
0

Thank you for giving me the cue. I guess that is complexity is O(1) because it always has two elements regardless of input or out. Is it right?

0

Since all you need is to calculate the out position from the two elements and no for-loop are required, it's O(1)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.