How To Rotate An Array In Java? | Array Rotation | FREE DSA Course in JAVA | Lecture 66
We have to write a program to rotate an array in Java.
What does the rotation of the array mean?
Consider an array 1,2,3,4,5 Rotating this array by 1 in counterclockwise means the newly rotated array will be 2,3,4,5,1.
Similarly rotating this array by 2 counterclockwise means the newly rotated array will be 3,4,5,1,2.
So we have to write a program to rotate an array by a given number k where the positive value of k denotes counterclockwise rotation and negative values of denote clockwise rotation.
This is a basic program that is generally asked in some companies.
Let's check out how you can solve this question with the most efficient approach.
Subscribe @TAPACADEMY for regular coding-related tips.
For more information, fill out this form: forms.gle/8eiUmM92Fx563Aen9
or call us at 8884881203
Facebook: / thetapacademy
Instagram: / tapacademy_online
Linkedin: / 73820805
Website: www.thetapacademy.com
#java #array #coding #programming #aarrayjava #javacourse #placementcourse
Пікірлер: 68
I have gone through the many DsA series on KZread and other platforms too. But seriously this is the best channel I have ever found to learn DSA.
He is such a phenomenal guy educating DSA in a simple and smooth way.
Only 934 likes . It deserves more . This channel is gem compared to other KZread gurus with 1 year exp,2 year exp in it industry having minimal knowledge
This type of explantion never got anywhere, thank you for making such kind of video
The Best video I have ever seen on a DSA, Thanks a lot sir for the effort you put in making the concept clear.
Such a amazing explanation
Definitely the best explanation by any DSA tutor I have ever seen on KZread !!
Respect for him. Best explanation and best quality content.
Damn! Such a good explanation with the best teaching tools 🔥. Awesome
The underappreciated channel. Sir(bhaiya) wonderful explanation thanks.
oh my god sir. You made me visualize and understand things so easily. I am very very thankful to you. Instant subscribe to ur channel. thanks. Please never get demotivated or stop making videos sir. People like me struggle to find someone who can teach like this and clear all doubts. Pls keep making videos always.
Best explanation....
The way he is teaching and pictorial representation is quite cool and easy to understand
i strong requrest you to continue the series best one please continue the series
Really so amazing video i ever seen on youtube with great visual representation
Thank you so much. i understood the concept very well
Awesome explanation
Best explanation sir ❤ Very clear explanation with super clarity of concepts
Sir your explaination is just looking like woww
This explanation is wise and can be understandable to 1st class students too..best explanation ever i heard in my life.
Bro your teaching is awesome!
Perfect explanation!!!!!💯💯💯💯💯
Perfectly explained :)
Bro... Your videos are quite good... We'd be very happy if u create more dsa related topics
awesome explanation
Best Explanation 😮
Best tutorial I ever watched 😃😊
Very nice visualization
Great teaching 🎉
very nicely explained and great visuals ❤❤
best explanation ever
Phenomenal explanation no body explain like you thank you so much🎉
sir ..i have never seen as good as this video content..
great explanantion
your teaching is like a Magician..
the besttt sirrrrr keepp goingggg🎉❤❤❤
Amazing sir
Thank you ❤
Vera level sir❤️
This channel should have million subscriber
Wonderful ❤
Hi Rohit Sir, Please continue the series other data structure as well.
mast video hai
brilliant🙌🙌
excellent
Best explanation
Thank you u sir
i love your teaching style ....you are awesome .
@travelpayya2668
Жыл бұрын
Sir😂😂 nice
This guy is awsome, the way he teaches even a donkey can understand
Thanks you
lit sir💥
thank you sir....
damn good 😇
It is me...? Or you can also see that, he looks like KL Rahul...😅 By the way your teaching style and presentation is very good... keep it up sir..🎉
Sir, Learning DSA from you is like watching Marvel's Movie;
That's awesome! But how to achieve all of it without using loops? :)
How we can do by java 8 Stream api ??
if you try on array of 3 elements and rotations as -4, the above code will fail. As 2nd call to reverse function --> reverse(a,-1,2), will fail as the array is out of bounds. As it can't start with index -1. So any rotation to the right (-ve number), which is greater than the length of Array is going to fail with the above reason.
❤❤❤❤❤❤❤❤❤❤
Best video found on this question, no-one on KZread has covered this topic and made easy to understand, thanks man ,
Damn Anirudh Ravichander teaches a nice coding apart from music
Who are you man? Awesome explanation… reply to my comment
@abhishekkr8077
Жыл бұрын
@karthickjayaraman2090 he is one of the best teacher bro,I am his student.His full name is Rabindra Rohit.We call him Rohit sir. He has his institute in Bangalore named Tap Academy in BTM layout area
public class Solution { public int[] solve(int[] A, int B) { B=B%A.length; for(int j=1;j
@harargeetube9807
8 ай бұрын
if condition for b
Awesome
❤❤❤❤❤ 💯