ROTATION of an array (REVERSAL Algorithm)

  Рет қаралды 51,583

Vivekanand Khyade - Algorithm Every Day

Vivekanand Khyade - Algorithm Every Day

7 жыл бұрын

Reversal Algorithm for ROTATION of an array. Rotate the array by given places. You have to rearrange the array by displacing or pushing the elements by k places left or right as given.
Reverse an Array :- • Reverse an Array witho...

Пікірлер: 70
@totsubo2000
@totsubo2000 5 жыл бұрын
Do you also have a video explaining how rotate an array using the Juggling Algorithm. It is more efficient than the reversal algorithm.
@sandeepmunavalli6345
@sandeepmunavalli6345 7 жыл бұрын
Hello Sir, your videos are very good, I see and each and every video. please keep on adding videos. I am learning lot
@karthikk5895
@karthikk5895 5 жыл бұрын
You gotta use r %= n to make sure the indices are bounded.
@ricardoorellana1168
@ricardoorellana1168 5 жыл бұрын
Hello Sir, what books did you use to learn this rotation algorithms?
@prajakta_patil
@prajakta_patil 5 жыл бұрын
Thank you so much :) Explanation is very clear and to the point. Appreciate your effort
@tapanjeetroy8266
@tapanjeetroy8266 5 жыл бұрын
Thanks for uploading it.. You are doing a great job.. Please upload more videos of competitive programming.. We really need it
@thesoftwareengineer17
@thesoftwareengineer17 4 жыл бұрын
Hey Vivek, dude u have some excellent teaching skills. thank you so much for such simple and understandable explanation.
@Sanjeev.Network
@Sanjeev.Network 6 жыл бұрын
Awesome bro,Awesome You are doing great work. Keep helping us we keep sharing your channel.
@ankitvarmait
@ankitvarmait 6 жыл бұрын
Thanks so much for such wonderful and simple explanation Required videos for Time complexity and Space complexity calculation in simple way
@sushma6314
@sushma6314 4 жыл бұрын
Anything in place like this for left rotation ?
@beaglesnlove580
@beaglesnlove580 2 жыл бұрын
This guy is the best teacher
@ruchu30
@ruchu30 5 жыл бұрын
you are awesome ... you made things simple :) . thanks a lot ...
@rohitsancheti96
@rohitsancheti96 6 жыл бұрын
hey man your videos are really helpful and to the point... cant thank you enough!!
@coderix1404
@coderix1404 2 жыл бұрын
Thankyou so much. It was very clear & helpful.
@SushrutKanetkar
@SushrutKanetkar 6 жыл бұрын
Thanks for the video !
@mohitsaini9148
@mohitsaini9148 5 жыл бұрын
yo man. you killed it...
@ashwiniv7053
@ashwiniv7053 5 жыл бұрын
Awesome explanation, I have a question, can we skip step two and add value B and value A
@shivamnerwal72
@shivamnerwal72 3 жыл бұрын
sir , you are doing a gret work
@kishorjha5028
@kishorjha5028 3 жыл бұрын
thank u for this video its clear my concept
@udayptp
@udayptp 2 жыл бұрын
Simply awesome approach sir
@satyanarayanakante7192
@satyanarayanakante7192 5 жыл бұрын
Please explain about k-way merge algorithm
@priyankashendage4823
@priyankashendage4823 3 жыл бұрын
Thank you so much sir for this video..it helped me.!!
@manojaswani7100
@manojaswani7100 7 жыл бұрын
Helpful indeed!
@hariprasadg123
@hariprasadg123 5 жыл бұрын
Good explanation. But are you checking array bounds are not exceeded? Please clarify.
@bhaskarnaik5842
@bhaskarnaik5842 2 жыл бұрын
So good explanation sir thanks
@jagdishwarbiradar1763
@jagdishwarbiradar1763 4 жыл бұрын
hey buddy , can you tell where we can use this algorithm plzz.., otherwise nice explanation
@VersaKumari-vu4ly
@VersaKumari-vu4ly Жыл бұрын
easy to understand thanks sir😊
@salihkurtov526
@salihkurtov526 5 жыл бұрын
Thanks!
@iamdurgeshk
@iamdurgeshk 5 жыл бұрын
What if r > n ? Let's say, n=6 and r=15. How would you do this then?
@saikrishnabarupati7218
@saikrishnabarupati7218 5 жыл бұрын
Then change r=r%n
@vishalpandyal853
@vishalpandyal853 4 жыл бұрын
What if number of rotations are more than number of elements in array.
@krishanakhatri8780
@krishanakhatri8780 6 жыл бұрын
Kindly make a video of block swap algorithm for array rotation.
@AbhishekSharma-uh8pb
@AbhishekSharma-uh8pb 4 жыл бұрын
where is the code for this program. can you please provide
@damodaranm3044
@damodaranm3044 4 жыл бұрын
really cool explaination
@NameXss
@NameXss 5 жыл бұрын
Ok, how to rotate matrix, if min(m, n) % 2 == 0. min(m, n) / 2 is number of rings of matrix
@ananthasubramanian7355
@ananthasubramanian7355 5 жыл бұрын
Thank you
@vatsalpagare6935
@vatsalpagare6935 4 жыл бұрын
In-place algorithm😊
@atifbashir7229
@atifbashir7229 6 жыл бұрын
Nice job
@raokshatri4515
@raokshatri4515 4 жыл бұрын
sir this is a left to right rotation. but also provide right to left rotation. thanks.
@devidas4320
@devidas4320 7 жыл бұрын
Pls make videos on Fenwick tree
@surenderlohia8227
@surenderlohia8227 4 жыл бұрын
Wow...
@ruchimishra2805
@ruchimishra2805 6 жыл бұрын
nice video
@181Ravikiran
@181Ravikiran 4 жыл бұрын
Can you add the code for it please, Thanks
@fuadhasan0362
@fuadhasan0362 6 жыл бұрын
thanks sir
@akashjitnayak6947
@akashjitnayak6947 5 жыл бұрын
Awesome
@meesamsyed8994
@meesamsyed8994 5 жыл бұрын
Make a video for Matrix rotation
@rachanadesai7984
@rachanadesai7984 5 жыл бұрын
can you please share the code?
@shabanashaik7135
@shabanashaik7135 6 жыл бұрын
Sir! How to reverse the words of a sentences
@unoop.
@unoop. 6 жыл бұрын
shabana shaik To reverse the words of a sentence you could use similar technique... First reverse each word and the reverse the output. Eg. REVERSE WORDS OF A SENTENCE - - > ESREVER SDROW FO A ECNETNES - - > SENTENCE A OF WORDS REVERSE. Hope that helps
@arvindgupta-zm7lz
@arvindgupta-zm7lz 5 жыл бұрын
can you please provide the code
@adarshkashyap8715
@adarshkashyap8715 4 жыл бұрын
Wow
@CengizAkarsu
@CengizAkarsu 4 жыл бұрын
Check out here also for algo: leetcode.com/articles/rotate-array/
@Rahul-vm3pv
@Rahul-vm3pv 4 жыл бұрын
********Here is Implementation of this theory in c Language*********** #include int main() { int n,arr[100],low,high,ele,rot,k; printf("Enter how many elements you want in your array "); scanf("%d",&n); printf("How many roations you want to perform "); scanf("%d",&rot); k = rot%n; for(int i=0;i
@user-rq4hf8ti4d
@user-rq4hf8ti4d 5 жыл бұрын
hello , who can help me to solve this question : Write a C++ program that reverses the order of a one-dimensional array of size 10 without using another array. Possible output: Original array is: 1 2 3 4 5 6 7 8 9 10 Reverse array is: 10 9 8 7 6 5 4 3 2 1
@mohammedajazquadri7869
@mohammedajazquadri7869 4 жыл бұрын
execute the programs in system also sir plz
@jagginadivya3680
@jagginadivya3680 5 жыл бұрын
Tq sir... I got an idea on this right niw
@ruchirsingh3635
@ruchirsingh3635 7 жыл бұрын
sir make a video on segment tree and binary index tree
@vivekanandkhyade
@vivekanandkhyade 7 жыл бұрын
Yes sure Ruchir....in 2 days ....i will make video on Segment tree.
@ruchirsingh3635
@ruchirsingh3635 7 жыл бұрын
thanqu sir
@vivekanandkhyade
@vivekanandkhyade 7 жыл бұрын
hey Ruchir...I have uploaded the video on Segment tree.. Please check the video
@rithikroosen2416
@rithikroosen2416 4 жыл бұрын
i approached it in different way
@leofun01
@leofun01 4 жыл бұрын
Why it sounds so funny ?
@suryareddy2171
@suryareddy2171 3 жыл бұрын
Rotateeft
@cinemaismywife
@cinemaismywife 6 жыл бұрын
That is not O(n) ....it is O(2n)
@MYUCOZ1
@MYUCOZ1 6 жыл бұрын
It is considered as O(n) because we ignore the non significant variable.
@unoop.
@unoop. 6 жыл бұрын
greatavielite O(2n) ~ O(n) it's technically linear time
@sundeepkaranam
@sundeepkaranam 5 жыл бұрын
Its actually O(1n)....since array reversal can be done in O(n/2).....No more discussion about O(2n)........
Implement two stacks in one array (Algorithm)
6:22
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 45 М.
Maximum Sum SubArray (Kadane's algorithm) (Largest Sum Contigous SubArray)
17:30
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 91 М.
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 40 МЛН
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 38 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 9 МЛН
Array Rotation In Place using C++ (Juggling Algorithm)
14:42
CodeWhoop
Рет қаралды 57 М.
Search an element in sorted and rotated array( Find PIVOT)
25:39
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 28 М.
Print Matrix Diagonally (Diagonal order)
13:22
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 109 М.
Leader in an Array (Code / Algorithm)
15:24
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 20 М.
Binary Search (Sorted Array) - O(log n) [ Best EXPLAINATION Algorithm]
20:27
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 62 М.
Remove Duplicates from sorted Array
21:22
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 168 М.
Easy Google Coding Interview With Ben Awad
28:00
Clément Mihailescu
Рет қаралды 1 МЛН
Rotate An Array Right | C Programming Example
4:53
Portfolio Courses
Рет қаралды 13 М.
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 40 МЛН