This is left rotation and not right rotation. Since you are using an array of size 4 so it seems the same thing here. Try for larger array size and see that this is the concept for left rotation. For right rotation: arr[i] = arr[(i+N-k)%N] , k = no. of rotations; N = array size Request you to please upload the video again otherwise it will confuse students.
Website Link: www.codewhoop.com/array/rotation.html
Support Us: www.patreon.com/codewhoop
may someone explain the logic behind this? ye okey it works for values cool, but how does one come up with this?
Great explanation, made it very clear! thank you :)
Bruh very awesome how have you think of these algorithm in new temp array?
Is the program of left and right are same?
Very nice and simple concept
Fantastic presentation ❤️
Great explanation🔥
Great man u must have given a lot of thought to create that formula
Bhai ye formula isne nhi bnaya ....
Please Sir
Start making videos regularly
tremendous bro
Nice tutorial! Thanks!
thanks a lot :)
what is the formula for left rotation?
arr[i] = arr[(i+N-k)%N]
@@abhishekpanda3400 the formula you gave above is for right rotation. In this video he actually explains left rotation.
Thank you sooo much dude
Great brother 👍🏻
Nice
This is left rotation and not right rotation. Since you are using an array of size 4 so it seems the same thing here. Try for larger array size and see that this is the concept for left rotation.
For right rotation: arr[i] = arr[(i+N-k)%N] , k = no. of rotations; N = array size
Request you to please upload the video again otherwise it will confuse students.
ya but this can also be called as right shifting of array elements
But this is not optimised solution.In this case Time complexity will be O(n*k) but for optimised solution time complexity will be O(n)
bro use the rotate function it has time complexity of o(n)
How about to the left
arr[i] = arr[(i+N-k)%N]
There is already a standard function in C++ which does rotate.
thank you very much
very good video sir
Thank you :D
Nice tut +1
Thank you :)
Anyone its time and space complexity please ?
Is this even allowed B[n] ? :/
Could you please do one with in-place k rotation?
Sure !! will work on it soon :)
There you go :) www.codewhoop.com/tutorial/array-rotation-in-place
THANK YOU!
What is the difference between this video and the in-place k rotation?
method in this video has space complexity of O(n) as we are using another array of the same size.
formula for left rotation?
arr[i] = arr[(i+N-k)%N]
nice
Thanks !!
Nice Nice Nice Nice Nice Nice Nice Nice :)
Thank you 😁
I want a code
I want a binod