2.8 Reverse a Linked List - Iterative Method | Data Structure Tutorials

  Рет қаралды 445,446

Jenny's Lectures CS IT

Jenny's Lectures CS IT

Күн бұрын

Пікірлер: 300
@himanshumangal8077
@himanshumangal8077 5 жыл бұрын
Finally someone who is teaching assuming the viewers are beginners.
@somhua5234
@somhua5234 3 жыл бұрын
This has to be the best linkedlist reversal video on the internet. Mam, you’re so good at breaking down such confusing logic into something so simple. You’re really blessed to be a teacher
@abhinavpeddapalli5906
@abhinavpeddapalli5906 2 жыл бұрын
Its easy mann
@bhuppidhamii
@bhuppidhamii Жыл бұрын
is it??
@Know_Youself
@Know_Youself Жыл бұрын
Use push method no need to do all things
@msrinu1579
@msrinu1579 Жыл бұрын
​@@Know_Youself if u know push method why did you watch and spend time in comment section
@swathiram9033
@swathiram9033 Жыл бұрын
​w wl 12
@riadhaidar7025
@riadhaidar7025 4 жыл бұрын
because of you ma'am i've understood everything in singly linked list and here is the full code : #include #include struct node { int data; struct node *next; }*head,*newnode,*temp; int pos; int n; void create(int n); void print(); void addbig(); void addend(); void addspecific(int pos); void delbeg(); void delend(); void delspecpos(); void getlength(); void reverse(); int main() { int num,choice; while(1){ printf(" ENTER '1' TO CREATE LINKED LIST: "); printf(" ENTER '2' TO ADD NODE AT BEGINNING: "); printf(" ENTER '3' TO ADD AT NODE THE END OF THE LIST: "); printf(" ENTER '4' TO ADD NODE AT SPECIFIC POSITION: "); printf(" ENTER '5' TO DELETE THE FIRST NODE: "); printf(" ENTER '6' TO DELETE LAST NODE: "); printf(" ENTER '7' TO DELETE A NODE FROM SPECIFIC POSITION: "); printf(" ENTER '8' TO GET LENGTH OF THE LIST: "); printf(" ENTER '9' TO REVERSE THE LIST: "); printf(" ENTER '10' TO EXIT: "); scanf("%d",&num); switch (num) { case 1: create(n); print(); break; case 2: addbig(); print(); break; case 3: addend(); print(); break; case 4: addspecific(pos); print(); break; case 5: delbeg(); print(); break; case 6: delend(); print(); break; case 7: delspecpos(); print(); break; case 8: getlength(); print(); break; case 9: reverse(); print(); break; case 10: printf("bye bye :) !!"); exit(0); break; default: printf("WRONG CHOICE...!"); }//end of switch statement }//end of while return 0; }//end of main void create(int n) { printf("enter the length of the list: "); scanf("%d",&n); struct node *newnode; head=0; int i; for(i=0;idata); newnode->next=0; if (head==0) { head=temp=newnode; } else {temp->next=newnode; temp=newnode; } } } void print() { temp=head; printf(" the list is: "); while(temp!=0) { printf("%d ",temp->data); temp=temp->next; } } void addbig() { struct node *newnode; if (head==0) { printf("invalid position"); } else { newnode=(struct node *)malloc(sizeof(struct node)); printf(" enter the data of new beginning node: "); scanf("%d",&newnode->data); newnode->next=head; head=newnode; } } void addend() { struct node *newnode; temp=head; if(head==0) { printf("invalied position"); } else{ newnode=(struct node*)malloc(sizeof(struct node)); printf(" enter the data of new last node: "); scanf("%d",&newnode->data); newnode->next=0; while(temp->next!=0) { temp=temp->next; } temp->next=newnode; } } void addspecific(int pos) { int j; printf(" enter position of newnode: "); scanf("%d",&pos); struct node *newnode; if (pos>n||posdata); for(j=0;jnext; } newnode->next=temp->next; temp->next=newnode; } } void delbeg() { printf(" first node will be deleted.... "); if (head==0) { printf("lsit is empty"); } else { temp=head; head=head->next; free(temp); } } void delend() { struct node *prevnode; printf(" last node will be deleted.... "); temp=head; while(temp->next!=0) { prevnode=temp; temp=temp->next; } if(temp==head) {head=0; } else{ prevnode->next=0; } free (temp); } void delspecpos() { int x; int posi; struct node *nextnode; temp=head; printf(" enter the position of node you want to delete: "); scanf("%d",&posi); for(x=0;xnext; } nextnode=temp->next; temp->next=nextnode->next; free(nextnode); } void getlength() { temp=head; int count; while(temp!=0) { count++; temp=temp->next; } printf(" list length is: %d",count); } void reverse() { struct node *prevnode,*current,*nextnode; prevnode=0; current=nextnode=head; while(nextnode!=0) { nextnode=nextnode->next; current->next=prevnode; prevnode=current; current=nextnode; } head=prevnode; }
@vineethnarayan5159
@vineethnarayan5159 4 жыл бұрын
Thank you for this
@riadhaidar7025
@riadhaidar7025 4 жыл бұрын
@@vineethnarayan5159 welcome
@aminaaslam33
@aminaaslam33 4 жыл бұрын
i'm about to take my exam of data structures and you made my day brother. Stay Blessed forever :)
@riadhaidar7025
@riadhaidar7025 4 жыл бұрын
@@aminaaslam33 all the best in your exams , good luck
@shinosukenohara.123
@shinosukenohara.123 4 жыл бұрын
maza aa gaya
@anubharathor7955
@anubharathor7955 4 жыл бұрын
Teachers like you are needed seriously....who give not only theories and codes....but knowledge also....
@pragmaticcoder6910
@pragmaticcoder6910 10 ай бұрын
No background music, No fancy introduction of channel or anything. Simple, to the point and perfect explanation. Thank you and God bless you.
@sachinkainth9508
@sachinkainth9508 3 жыл бұрын
I have 20 years of development experience in industry but still I have found reversing a linked list to be quite difficult, until that is I came across this excellent video.
@sreeharimysore838
@sreeharimysore838 5 жыл бұрын
Reversing the linked list is always a confusing stuff for me. But finally I got this concept clear with your unique style of explanation. Very grateful to you MadamJi ... !
@pratikpatil8938
@pratikpatil8938 5 жыл бұрын
This is my favorite u tube channel to learn data structure and algoritham... thanks mam💻
@somsuryananda
@somsuryananda 5 жыл бұрын
Dear Jenny, You seem to enlighten us on a daily basis. Your way of teaching is very simple and yet very impacting. Thank you for all you have done/posted. 😊😊 Wish you all success in life and career.
@SanjayKIG
@SanjayKIG 5 жыл бұрын
Finally someone who is teaching assuming the viewers are beginners. Subscribing the channel for more viewership and exposure. Good luck. We really dont mind the long length of the videos.
@rwcodingg
@rwcodingg Жыл бұрын
😂😂😂😂😂
@dhruvmehra2730
@dhruvmehra2730 2 ай бұрын
I can't believe the way she taught...mindblowing hatts off to ur efforts mam!!🎉🎉🔥
@mridupawan2670
@mridupawan2670 5 жыл бұрын
YOU'RE TRUELY ONE OF THE FINEST TEACHERS!!
@anupamanand8733
@anupamanand8733 3 жыл бұрын
Whenever i watch your video it feels like i was sitting in the classroom. I spent my whole one day but not find out how to reverse. finally after watching this video i solve the problem in minutes.
@AYAMDASH
@AYAMDASH 3 ай бұрын
Finally a video for all levels of students.Its deeply intriguing and really helps boulangerie of epic proportions
@bhadreesh787
@bhadreesh787 5 жыл бұрын
Hi Ma'am Happy Teachers Day....Ma'am Your Teaching is so Understandable that any Below Average Students can also easily Grasp the Concepts..Jayanti Ma'am please Cover all the Concepts of "Advanced Data Structures & Algorithms" without leaving even a Single Concept...You are also having so "Beautiful Face along with Beautiful Voice & Genius Brain"💐🎂...You will Definitely become one of the Reputed KZbin Professor in front of the Whole World...I will be waiting for that Day👍
@JennyslecturesCSIT
@JennyslecturesCSIT 5 жыл бұрын
Thanks you ... :)
@yuktagaba525
@yuktagaba525 4 жыл бұрын
Thanks a lot for making us understand this easily. I went through a lot of videos but yours is actually the "BEST" one.
@tesfayewako5304
@tesfayewako5304 4 жыл бұрын
This is my favorite youtube channel to learn whatever course in computer science......i lv u so much mam
@xueli2379
@xueli2379 2 жыл бұрын
omg, I'm a girl and I wanna say I love you! You are such a good teacher who makes this complicated knowledge into something clear and understandable. Thank you! Appreciated all your work!🥰🥰🥰
@f3funfactsformula277
@f3funfactsformula277 2 жыл бұрын
Love you too
@MDSHAHABUDDIN-ep4rc
@MDSHAHABUDDIN-ep4rc 4 жыл бұрын
Blessed, thrilled, excited all at the same time to have a teacher like you!!
@aritralahiri8321
@aritralahiri8321 4 жыл бұрын
Most simple and clear explanation I've come across so far . Keep us providing with more of these wonderful videos. Much appreciated !
@prinkaraina2511
@prinkaraina2511 5 жыл бұрын
Best KZbin channel for data structure ☺️
@saqibjaved1623
@saqibjaved1623 5 жыл бұрын
Just one word for u mam "ZABARDAST" . GREAT explanation and simple style, and i loved my all teachers but u r one of the best teacher ever on dsa.😍😍😍😍
@srivanikothavadla4606
@srivanikothavadla4606 4 жыл бұрын
Madam you have a lot of patience....while learning in my class I faced lot of confusion but now my all doubts are clarified..your doing greatest service for the poor people that who are not able to invest..thank you is very small word but it contains lot of emotional feeling 🙏
@aashishshrestha8180
@aashishshrestha8180 4 жыл бұрын
feel like tuition class.. thank you madam .. from Nepal
@bishalrajbhattarai5482
@bishalrajbhattarai5482 4 жыл бұрын
Hai bro!! Malai pani testai lagchha
@afairywithdemonwings
@afairywithdemonwings 4 жыл бұрын
Being in the Final year and preparing DS and ALGO for placement. What have I learned from college NOTHING. What have I learn from you is the logic behind those from scratch. You have my utmost respect. I will again comment you when I will get a Job. Stay happy, stay safe and take care Ma'am .:-)
@JennyslecturesCSIT
@JennyslecturesCSIT 4 жыл бұрын
Best wishes
@afairywithdemonwings
@afairywithdemonwings 4 жыл бұрын
@@JennyslecturesCSIT Thank you Ma'am😊
@shreyanshmishra6613
@shreyanshmishra6613 4 жыл бұрын
never have i ever been taught like this before.... concepts are so clear to me now that I can bloody teach someone.
@gls863
@gls863 28 күн бұрын
Thank you so much Ma'am, your explanations are so easy to understand !!
@shobujdas
@shobujdas 3 жыл бұрын
Last year I got A+ in the discrete mathematics course watching your video. Now I am watching DS videos .. (Love from Bangladesh
@AbhishekSingh-tz3uv
@AbhishekSingh-tz3uv 3 жыл бұрын
Seeing just the first 5 mins of this video got me clear the whole traversal & reversal process. Thanks for such a wonderful content!
@asmitswarnakar7551
@asmitswarnakar7551 Жыл бұрын
Bestest explanation of reverse linked list , for your struggle I have clear knowledge in DSA, thankyou ma'am ❤
@mahimsd7645
@mahimsd7645 5 жыл бұрын
Excellent explanations Jenny ... God bless you !!!!
@lipsmackin3826
@lipsmackin3826 10 ай бұрын
I've subscribed ❤ thank you for explaining it so easily and clearly, finally I understood how to reverse linked list after coming across many complicated videos
@gabriellerosa6453
@gabriellerosa6453 4 жыл бұрын
PERFEITA MARAVILHOSA SEM DEFEITOS, toda vez que tenho que reverter uma lista eu colo aqui
@Turjackb
@Turjackb 7 ай бұрын
your are the best teacher i have ever seen
@nephophile4461
@nephophile4461 6 ай бұрын
Your schematic representation are best. Thanks a lot!
@JagadisM
@JagadisM 4 жыл бұрын
Ur teaching skills are really awesome... simple and concise... I understood this concept... Ur doing invaluable service in CS teaching in India. U really deserve President award for teaching..Hats off u ..Maam..
@raviease
@raviease Жыл бұрын
Extraordinary Teaching Skills 🙇‍♂🙇‍♂
@zakirazakira6951
@zakirazakira6951 4 жыл бұрын
very nicely explained. exceptional style of teaching. god bless you . thanks
@syedmansoor4069
@syedmansoor4069 2 жыл бұрын
Sabse acha data structure apne padhaya h...mene ummid hi kho di thi....god bless you........or bhi vedio bnado maim....Hindi me record krdo possible ho ske to
@funshorts1248
@funshorts1248 4 жыл бұрын
Truly Grateful for these lectures ~
@ramswrooppatidar7599
@ramswrooppatidar7599 3 жыл бұрын
woaw ma'am ! your teaching skill is absolutley faad👌👌, many more teachers and lectures on you tube but i love the way you teach ! when im free i will draw your beautiful sketch 🙌🙌
@johnp836
@johnp836 2 жыл бұрын
ALWAYS I SUPRISED BY YOUR TEACHING MAM, IT's BEEN LIKE SPOON FEEDING VERY EASY TO UNDERSTAND MAM, THAN YOU SO MUCH
@swatijha8656
@swatijha8656 4 жыл бұрын
today I taught my frnd linked list after learning from your video & he was like wow !! bhot acche se explain Kiya phli Baar mein hi sab smjh aagya...Thnq soo much mam, U teach soo well
@vaibhavgupta777
@vaibhavgupta777 Ай бұрын
Thank You Mam So So Much🙏🙏🙏🙏
@harnishsavadia7619
@harnishsavadia7619 3 жыл бұрын
Finally found a video that explains the concept so systematically! Thanks a lot!
@murtazamehdi9992
@murtazamehdi9992 3 жыл бұрын
greatest instructor of all time 🙏🙏🙏
@ronitchaurasia5604
@ronitchaurasia5604 4 жыл бұрын
The way she smiles at end of every video is love......till then bye bye take care...
@omkarkumar3769
@omkarkumar3769 3 жыл бұрын
ma'am your level of explanation is really very helpful... and understandable. their are lot of video on ds on different platform i visited almost source possible for learning ds but i don't find any video content around you .... this is best content i ever seen on d.s ..ma'am small love from younger brother ..from bihar..
@anil9324
@anil9324 2 жыл бұрын
Ever hear these kind of lectures.Thank u mam for providing better lectures for us.❤❤❤
@majdalin1265
@majdalin1265 Жыл бұрын
I love your way of teaching PLEASE do a video of how to delete all negative numbers in a linked list
@aakashmudigonda3375
@aakashmudigonda3375 4 жыл бұрын
She's dope man😍😍😍 DS and ALGO MADE BEAUTIFUL😌
@uk1523
@uk1523 4 жыл бұрын
One of the easiest way to reverse linkedlist Great work ma'am Keep it up 👍
@Khatarnak.Bakchodi
@Khatarnak.Bakchodi 3 жыл бұрын
Good explanation Jenny! I could understand logic in 5 mins and create my own program
@pcpardon
@pcpardon 3 жыл бұрын
Thank you, Jayanthi.. explanation is awesome. Straight to the basics... no need to memorize.. all logical
@KanhaiyaKumarbcs
@KanhaiyaKumarbcs 4 жыл бұрын
Thanks a lot mam....you are working hard for us.....perfectly explained everything .
@vanguardianfps4545
@vanguardianfps4545 3 жыл бұрын
Thank You So much by far the best Reversal Video !!!
@saijaswanth5085
@saijaswanth5085 4 жыл бұрын
greatest work by the most beautiful youtuber. thanks mam
@rajeevsai91
@rajeevsai91 3 жыл бұрын
Liked the teaching approach. What we might miss when traversing and the logic to hold them. Nice. Thanks.
@motivalife1234
@motivalife1234 Жыл бұрын
Mam your lec so helpful ... I understand all points very well❤❤ ...great work 👍👍
@arshadbagwan3039
@arshadbagwan3039 4 жыл бұрын
I am grateful to you for this video. It helps me alot thanks!
@narendrarana5552
@narendrarana5552 4 жыл бұрын
Nice explanation indeed, and reversal of string can be done using 2 pointers, 3rd extra pointer not required.
@dharmendrasharma9317
@dharmendrasharma9317 3 жыл бұрын
Mam ji namste 🙏🏼🙏🏼 Your teaching way is very very admirable
@debupatra2333
@debupatra2333 4 жыл бұрын
best explanation for reversing the linked list. Thank you maam!
@iscxii6415
@iscxii6415 3 жыл бұрын
Very beautifully explained ...the working you have made us visualize it
@DurgaSaathwikKolla
@DurgaSaathwikKolla 8 ай бұрын
Thank you very much mam. you made me learn without skipping backwards😊😊😎😎
@muhammadnaseeraslam7552
@muhammadnaseeraslam7552 3 жыл бұрын
Big Fan Ma'am From Pakistan Stay Blessed
@sujaikrishnanc9646
@sujaikrishnanc9646 2 ай бұрын
Basically, you try to reverse the links rather than traversing each element in an array and then reversing elements. If you think that way, you get the steps for the code. By this way you get the most efficient solution. This one takes exactly O(n) and the former one takes a little above O(n) as time complexity. Also least complexity.
@savangolakiya1926
@savangolakiya1926 Жыл бұрын
this is what student is always looking for!!!!!
@poojithaborra1650
@poojithaborra1650 4 жыл бұрын
Hi mam, I am from ece stream and not familiar with how to calculate the timing complexity of an algorithm. I have understood a little about big O notation from ur explanations but if u could make a separate video, that would be very helpful. Your way of explaining is very good and clear. These videos are very helpful. Thanks mam☺️
@ehabreda365
@ehabreda365 4 жыл бұрын
Very clear explanation thank you from Egypt
@ashashainianumolu3792
@ashashainianumolu3792 3 жыл бұрын
Speechless, mind blowing explanation mam....keep going and we are looking forward for more easy understanding, useful concepts like this.... Fan from Andhra Pradesh....
@sasikirankakara3773
@sasikirankakara3773 5 жыл бұрын
Awesome Teaching Mam!!!
@awweee6568
@awweee6568 2 жыл бұрын
Sabse pahle tah-e-dil se shukriya. Ek sawal hai, zehan me. Kyu na while loop ki shuruati line ye ho nextnode = currentnode->next; bajaye isake nextnode = nextnode->next; Ye dono mere mutabik ek hi tarah se kam karengi, lekin dimag ke liye uper wali line jyada asardar hogi
@KUSUMAKARSHUKLA
@KUSUMAKARSHUKLA 4 жыл бұрын
I took cormen. Left it. I downloaded tens of books. I read , I yawned and I stopped. Suddenly one day this video pops up on my youtube screen. Woaaah, my mind said.
@vibhu613
@vibhu613 4 жыл бұрын
✌🥳✌
@shreejashukla331
@shreejashukla331 5 жыл бұрын
Thanku mam... Finally I can understand this topic...
@hmjawad087
@hmjawad087 3 жыл бұрын
Code with Harry and Miss Jenny. They are performing much more better than so called PHD stupid scholars in the University. Love from Pakistan!
@nuraynasirzade
@nuraynasirzade Жыл бұрын
your amazing!! i love you Teacher🥰🥰🥰
@aachalmozare8675
@aachalmozare8675 4 жыл бұрын
Your explanation is so clear..thanku mam
@kickbuttowsk2i
@kickbuttowsk2i 5 жыл бұрын
struggled for 40mins without any direction, finally understood.
@mainulhasanrifat
@mainulhasanrifat 4 жыл бұрын
Mam your lectures are awesome. Keep it up for us. Best wishes.
@ashishpant5548
@ashishpant5548 Жыл бұрын
Thanks mam for sharing your knowledge. It helped me a lot
@bitthalverma842
@bitthalverma842 3 жыл бұрын
Mam aap abhut accha samjhate ho keep it up mam you are the only one with great content aman bhaiya ka bhi course accha hai but explaination for beginers is very poor
@dilshad_ahmed
@dilshad_ahmed 5 жыл бұрын
Wow mam 1 time me clear ho gya...... thanks
@sayantaniguha8519
@sayantaniguha8519 3 жыл бұрын
3:11 after reversal, each node's "next" contains address of that node's previous node.
@biswajitadhikary_0807
@biswajitadhikary_0807 2 жыл бұрын
best teaching method
@snehamareddy1867
@snehamareddy1867 4 жыл бұрын
Your teaching method is awesome sis
@sugaashi
@sugaashi 5 ай бұрын
Thanks a lot ma'am! Very helpful
@sandipsarkar1516
@sandipsarkar1516 4 жыл бұрын
Thank you mam... Very Helpful for umcoming gate and net exam
@richashree3345
@richashree3345 2 жыл бұрын
Best explanation .....Thank you Mam☺
@adhargupta3441
@adhargupta3441 3 жыл бұрын
Maza aajaate he yr padhke🌝❤️❤️
@khaledov7305
@khaledov7305 6 ай бұрын
Thank you so much for your efforts.
@srishtimishra5101
@srishtimishra5101 4 жыл бұрын
Thank you so much ma'am God bless you and ur family
@amanrajawat2977
@amanrajawat2977 4 жыл бұрын
Very nice explanation hatts off u🥰
@sunilvarmatongali4599
@sunilvarmatongali4599 2 жыл бұрын
Superb, Thanks❤❤❤❤❤❤
@karthickm7045
@karthickm7045 5 жыл бұрын
super mam. i request you to post video on interview question and answer also please. then post video on mirror program in c.
@danishthev-log2264
@danishthev-log2264 4 жыл бұрын
Mam u r awesome lecturer...very good conepts....😘😉
@mohdkashanchaudhary2387
@mohdkashanchaudhary2387 3 жыл бұрын
she has awesome teaching skills
@JohnWickea
@JohnWickea Жыл бұрын
thank you so much for this beautiful explanation mam.
@vishalchauhan9832
@vishalchauhan9832 5 жыл бұрын
Nice lecture mam ji 😍
@sandhyavishwa1484
@sandhyavishwa1484 4 жыл бұрын
gjbb ekbrr mai hi smgh gyiii
2.9 Introduction to Doubly Linked List in Data structures | DSA Tutorials
8:54
Jenny's Lectures CS IT
Рет қаралды 385 М.
2.10 Implementation of Doubly Linked List - Data Structures
21:14
Jenny's Lectures CS IT
Рет қаралды 435 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
2.4 Linked List Implementation in C/C++ | Creation and Display | DSA Tutorials
29:01
Jenny's Lectures CS IT
Рет қаралды 1,8 МЛН
7.6 Quick Sort in Data Structure | Sorting Algorithm | DSA Full Course
24:43
Jenny's Lectures CS IT
Рет қаралды 2,8 МЛН
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 10 М.
4.1 Queue in Data Structure | Introduction to Queue | Data Structures Tutorials
20:19
2.1 Introduction to Linked List | Need of Linked List | DSA Tutorials
22:11
Jenny's Lectures CS IT
Рет қаралды 1,3 МЛН
3.6 Infix to Postfix using Stack | Data Structures Tutorials
20:10
Jenny's Lectures CS IT
Рет қаралды 1,8 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН