2525
2626## Method to Left Rotate Array
2727
28- For multiple Elements instead of rotating one by one use simple methode .
28+ For multiple Elements instead of rotating one by one use simple method .
2929
3030To rotate K elements to right side from left side do below steps
3131
32- 1 . Devide Array into to part
32+ 1 . Divide Array into two parts
3333
3434 I. First part contain first K elements of array.
3535
4545
4646 Array : {1,2,3,4,5,6} and K = 2
4747
48- Step 1 : Devide
48+ Step 1 : Divide
4949
5050 part1 = {1,2} and part2 = {3,4,5,6}
5151
@@ -68,23 +68,23 @@ Same as above.
6868
6969To rotate K elements to left side from right side do below steps
7070
71- 1 . Devide Array into to part
71+ 1 . Divide Array into two parts
7272
73- I. First part contain first total elements minus last K elements of array.
73+ I. First part contains first total elements minus last K elements of array.
7474
7575 II. Second part contain last K elements of array.
7676
77772 . Create new Array to store result.
7878
79793 . Now store second part of array into result array.
8080
81- 4 . Last store first part of array.
81+ 4 . Lastly store first part of array.
8282
8383Eg. :
8484
8585 Array : {1,2,3,4,5,6} and K = 2
8686
87- Step 1 : Devide
87+ Step 1 : Divide
8888
8989 part1 = {1,2,3,4} and part2 = {5,6}
9090
@@ -132,7 +132,7 @@ class ArrayRotation {
132132
133133 }
134134
135- // Right Rotate Methode
135+ // Right Rotate Method
136136 public static void printRightRotated (int [] arr , int k ) {
137137 // Create Result Array to store result
138138 int rightRotate[] = new int [arr. length];
0 commit comments