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

  • @gauribhosale8712
    @gauribhosale871210 ай бұрын

    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.

  • @jayprakashKumar-hp3hw
    @jayprakashKumar-hp3hw Жыл бұрын

    He is such a phenomenal guy educating DSA in a simple and smooth way.

  • @jithindev9185
    @jithindev918528 күн бұрын

    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

  • @rutikbodkeacademy1247
    @rutikbodkeacademy12478 ай бұрын

    This type of explantion never got anywhere, thank you for making such kind of video

  • @nallapatiDeepak-bl3wx
    @nallapatiDeepak-bl3wx Жыл бұрын

    The Best video I have ever seen on a DSA, Thanks a lot sir for the effort you put in making the concept clear.

  • @sidsid7464
    @sidsid746420 күн бұрын

    Such a amazing explanation

  • @raam2508
    @raam25083 ай бұрын

    Definitely the best explanation by any DSA tutor I have ever seen on KZread !!

  • @Hasan_770
    @Hasan_7709 ай бұрын

    Respect for him. Best explanation and best quality content.

  • @Pradeepkumar-es8qm
    @Pradeepkumar-es8qm Жыл бұрын

    Damn! Such a good explanation with the best teaching tools 🔥. Awesome

  • @mridulgarg2539
    @mridulgarg2539 Жыл бұрын

    The underappreciated channel. Sir(bhaiya) wonderful explanation thanks.

  • @user-dx8fw2dc6h
    @user-dx8fw2dc6h7 ай бұрын

    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.

  • @khusheeranjan7848
    @khusheeranjan784813 күн бұрын

    Best explanation....

  • @vishnubj826
    @vishnubj8265 ай бұрын

    The way he is teaching and pictorial representation is quite cool and easy to understand

  • @nitishm1274
    @nitishm12745 ай бұрын

    i strong requrest you to continue the series best one please continue the series

  • @user-qr9uo5it2r
    @user-qr9uo5it2r4 ай бұрын

    Really so amazing video i ever seen on youtube with great visual representation

  • @tamilmukbang3789
    @tamilmukbang37895 ай бұрын

    Thank you so much. i understood the concept very well

  • @arjunreddy2170
    @arjunreddy2170 Жыл бұрын

    Awesome explanation

  • @tejassalunkheofficial
    @tejassalunkheofficial6 ай бұрын

    Best explanation sir ❤ Very clear explanation with super clarity of concepts

  • @shaikshafiulla684
    @shaikshafiulla6843 ай бұрын

    Sir your explaination is just looking like woww

  • @PathanVlogs098
    @PathanVlogs0983 ай бұрын

    This explanation is wise and can be understandable to 1st class students too..best explanation ever i heard in my life.

  • @hari7110
    @hari71105 ай бұрын

    Bro your teaching is awesome!

  • @programmingpartner8624
    @programmingpartner86245 ай бұрын

    Perfect explanation!!!!!💯💯💯💯💯

  • @grozageorge2887
    @grozageorge288710 ай бұрын

    Perfectly explained :)

  • @survivourff7014
    @survivourff701417 күн бұрын

    Bro... Your videos are quite good... We'd be very happy if u create more dsa related topics

  • @richatripathi5919
    @richatripathi5919 Жыл бұрын

    awesome explanation

  • @naag4852
    @naag485211 ай бұрын

    Best Explanation 😮

  • @Heroff_123
    @Heroff_123Ай бұрын

    Best tutorial I ever watched 😃😊

  • @payalsingh7238
    @payalsingh72386 ай бұрын

    Very nice visualization

  • @saksheepapadkar6087
    @saksheepapadkar608711 ай бұрын

    Great teaching 🎉

  • @user-vs7bb8xm2m
    @user-vs7bb8xm2m5 ай бұрын

    very nicely explained and great visuals ❤❤

  • @parulbhati2373
    @parulbhati237323 күн бұрын

    best explanation ever

  • @rohithbathula1239
    @rohithbathula1239Ай бұрын

    Phenomenal explanation no body explain like you thank you so much🎉

  • @shivamjha6917
    @shivamjha69173 ай бұрын

    sir ..i have never seen as good as this video content..

  • @smrutinayak2628
    @smrutinayak2628Ай бұрын

    great explanantion

  • @ms_007_
    @ms_007_2 ай бұрын

    your teaching is like a Magician..

  • @crankyysalt6963
    @crankyysalt69634 ай бұрын

    the besttt sirrrrr keepp goingggg🎉❤❤❤

  • @gagugaganashree7879
    @gagugaganashree7879 Жыл бұрын

    Amazing sir

  • @206_dindayalpatra3
    @206_dindayalpatra33 ай бұрын

    Thank you ❤

  • @7smessi803
    @7smessi80310 ай бұрын

    Vera level sir❤️

  • @azadchauhan963
    @azadchauhan9634 ай бұрын

    This channel should have million subscriber

  • @twishanuaichroy1938
    @twishanuaichroy19386 ай бұрын

    Wonderful ❤

  • @EngineerbyFate
    @EngineerbyFate2 ай бұрын

    Hi Rohit Sir, Please continue the series other data structure as well.

  • @user-lh5tq7jd3r
    @user-lh5tq7jd3r Жыл бұрын

    mast video hai

  • @user-yn6js2xh9z
    @user-yn6js2xh9z7 ай бұрын

    brilliant🙌🙌

  • @invinciblevikas9553
    @invinciblevikas9553 Жыл бұрын

    excellent

  • @AnkiD-ub2ju
    @AnkiD-ub2ju7 ай бұрын

    Best explanation

  • @Tech_most
    @Tech_most5 ай бұрын

    Thank you u sir

  • @shubhampatidar3815
    @shubhampatidar3815 Жыл бұрын

    i love your teaching style ....you are awesome .

  • @travelpayya2668

    @travelpayya2668

    Жыл бұрын

    Sir😂😂 nice

  • @HarshKumar-nf7xr
    @HarshKumar-nf7xr Жыл бұрын

    This guy is awsome, the way he teaches even a donkey can understand

  • @syamprasadupputalla8233
    @syamprasadupputalla823310 ай бұрын

    Thanks you

  • @uttamsahu8224
    @uttamsahu822410 ай бұрын

    lit sir💥

  • @manulovanshi8638
    @manulovanshi86385 ай бұрын

    thank you sir....

  • @Cryengineers8205
    @Cryengineers8205 Жыл бұрын

    damn good 😇

  • @ankurmandal8899
    @ankurmandal88993 ай бұрын

    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..🎉

  • @jayanksingh4852
    @jayanksingh48528 ай бұрын

    Sir, Learning DSA from you is like watching Marvel's Movie;

  • @viewer_evgeniy
    @viewer_evgeniy8 ай бұрын

    That's awesome! But how to achieve all of it without using loops? :)

  • @aniketrawal4961
    @aniketrawal49615 ай бұрын

    How we can do by java 8 Stream api ??

  • @user-zz2ln4dc4u
    @user-zz2ln4dc4u6 ай бұрын

    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.

  • @user-vf3eg3wt1p
    @user-vf3eg3wt1p4 ай бұрын

    ❤❤❤❤❤❤❤❤❤❤

  • @UtkarshOjha
    @UtkarshOjha6 ай бұрын

    Best video found on this question, no-one on KZread has covered this topic and made easy to understand, thanks man ,

  • @saisooryamarri4042
    @saisooryamarri404210 ай бұрын

    Damn Anirudh Ravichander teaches a nice coding apart from music

  • @karthickjayaraman2090
    @karthickjayaraman2090 Жыл бұрын

    Who are you man? Awesome explanation… reply to my comment

  • @abhishekkr8077

    @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

  • @athiyastudies
    @athiyastudies10 ай бұрын

    public class Solution { public int[] solve(int[] A, int B) { B=B%A.length; for(int j=1;j

  • @harargeetube9807

    @harargeetube9807

    8 ай бұрын

    if condition for b

  • @Entertainment.Tube0
    @Entertainment.Tube0 Жыл бұрын

    Awesome

  • @Entertainment.Tube0
    @Entertainment.Tube0 Жыл бұрын

    ❤❤❤❤❤ 💯