- Program for Array Rotation
- 1st Method - Using temp array - Time complexity - O(n), Space - O(d)
See algo and code - 2nd Method - rotate one by one - Time complexity - O(n*d), Space - O(1)
See algo and code - 3rd Method - Juggling Algorithm - Time Complexity - O(n), Space - O(1)
seel algo and code - 4th Method - Reversal Algorithm - Time Complexity - O(n)
see algo and code
No comments:
Post a Comment