Array Rotation | GeeksforGeeks

preview_player
Показать описание

Practice Problem Online Judge:

This video is contributed by Aditi Bainss

Please Like, Comment and Share the Video among your friends.

Also, Subscribe if you haven't already! :)
Рекомендации по теме
Комментарии
Автор

Like Einstein once said - "If you can't explain it simply, you haven't understood it well enough."

noone_and_nobody
Автор

juggling algorithm ko aur jungle bna diya... kuch samajh nahi aaya... 😤😤😤😤

SUJEETKUMAR-gdxy
Автор

The code explaination is very rushed and hard to understand. All the effort to publish the video is in vain if the explaination is so rushed. Thanks anyways.

Sdr
Автор

Person himself don't know the algorithm. 1000 dislikes would be sort for this video

true_human_
Автор

What are you doing man ...you're just reading the slide not even explain that actual important code loop content ...which is tough to understand man !

aayushjoshi
Автор

EASY METHOD TO ROTATE AN ARRAY BY K POSITIONS:-
For eg:- Let the input list be {1, 2, 3, 4, 5, 6, 7} and let's say we want to rotate the array by 2 positions ( k=2),
so the output array should be {6, 7, 1, 2, 3, 4, 5}
step 1: Reverse the whole list. {7, 6, 5, 4, 3, 2, 1}
step 2: Reverse k elements in the list. { 6, 7, 5, 4, 3, 2, 1 }
step 3: Reverse the remaining n-k elements in the list. { 6, 7, 1, 2, 3, 4, 5 }

soumyadeepmitra
Автор

Only this much should work : rotation factor = 3(lets say)
for(int i=0; i< arr.length - factor; i++){
temp = arr[i] ;
arr[i] = arr[i+factor];
arr[i+factor] = temp;
}
Simple swapping with i+factor and at least rotated to left. If want forward rotaion, start loop from end with same logic. Hope this will help. LEt me know if any case failed. Thanks GFG.

abhirooptayal
Автор

very bad explanation, i did understood not a bit to solve this problem n further

_vasumateti
Автор

another gfg explanation video another disappointment

RohitRaj-owyy
Автор

Bhai samjhane ke time likh kya rahe hote ho ye to tum jo bolte ho or screen pr jo likhata hai wahi dhakk leta hai and ye tumhare sare video ke problem hai, tum apna tym waste kar rahe ho

tanish__
Автор

Thanks for wasting our time and internet...

tanishadixit_
Автор

I was eagerly waiting for the video to come on juggling algo so i could understand how it works and.. in a blink of eye it was done, man if wanted to just see how it looks i wouldn't have opened youtube for it, atleast i expected a qualitative content and explanation from gfg !

DeepShahh..
Автор

none of your videos are beginner friendly

sandipbhowmik
Автор

Appreciate your efforts for posting the questions and solutions. But your voice is so annoying and it feels like you are just reading the ppts. Improvement of the presentation quality can make g4g channel a boon for people like us. :)

rajeshdansena
Автор

pike video banaya bhau? kam piya karo..

InDiAnAjOnEs
Автор

the video explanation was not usefull at at..couldnt understand the juggling algo

zombnie
Автор

If any matlab lover watching the video ----
MATLAB code to rotate an array in clockwise direction:


x=input('Enter the array:');
Y=[];
a=input('Enter the required amount of circular shift:');
k=1;
for i=a+1:length(x)
Y(k)=x(i);
k=k+1;
end
for i=1:a
Y(k)=x(i);
k=k+1;
end
disp(Y)

KnowledgeAmplifier
Автор

One question I want to ask
If we are given an array 7, 5, 8, 2, 3, 4 here n=6 & d=4 then how to rotate this array using juggling algorithm by d places?

jiteshmeghwal
Автор

First check your eligibility to explain such topics then move forward.

imran_
Автор

How will method 3 handle the case when the GCD is 1?

anujpancholi