Це відео не доступне.
Перепрошуємо.

L9. Reverse a LinkedList | Iterative and Recursive

Поділитися
Вставка
  • Опубліковано 25 лис 2023
  • Problem Link: tinyurl.com/2a...
    Entire LL Sheet: takeuforward.o...
    Check our A2Z DSA Course: takeuforward.o...
    Please do give us a like, and subscribe to us if you are new to our channel.
    Do follow us on our socials: linktr.ee/take...

КОМЕНТАРІ • 138

  • @pratulyapratap9329
    @pratulyapratap9329 8 місяців тому +63

    U r not only teaching linkedlist u r teaching values to give back to this community..
    Thankyou Striver

  • @samreenimam8608
    @samreenimam8608 3 місяці тому +15

    I was confused until I watched the dry run of recursion... Thanks for having Striver!..

  • @aryanpinto5105
    @aryanpinto5105 8 місяців тому +14

    Was a bit confused regarding recursive approach of this problem for a while. Your explanation just cleared out all of it. Great video!!❤💯

  • @tanishagupta9997
    @tanishagupta9997 8 місяців тому +19

    Hands down, the best explanation on UA-cam!

  • @_SahilShah
    @_SahilShah 20 днів тому +1

    00:10 Iterative Approach
    14:39 Recursive Approach
    very nice explanation Striver!
    Understood!

  • @surayahappy120
    @surayahappy120 8 місяців тому +64

    so beautiful so elegant just looking like a wow

  • @durgeshjadhav01
    @durgeshjadhav01 4 місяці тому +4

    Logic are crystal clear with your perfection in explanation , i don't even
    need to look code .

  • @abid3801
    @abid3801 6 місяців тому +5

    Awesome man. The way you tried to portray the recursive one is actually over the moon..

  • @sanchitsanyam7359
    @sanchitsanyam7359 3 місяці тому +9

    recursive approach of soving linked list is awesome non of any youtuber has explained it such fantastically

  • @AmanSharma-xy1qm
    @AmanSharma-xy1qm 8 місяців тому +5

    All the video lectures and the articles helped me a lot to gain confidence in DSA and will be helping me in the interviews. Thank you Striver bhaiya for bringing such amazing content for free.

  • @hardikkumarsingh
    @hardikkumarsingh 6 місяців тому +3

    Exceptional explanation !!! I've never intuitively understood recursive version of reversing a LinkedList, but this video helped me understand that too so easily🙇🙇

  • @jeanishverma6898
    @jeanishverma6898 5 місяців тому +3

    In iterative method use this , if you get null exception:
    Node temp = head;
    Node p = null;
    While(temp!=null){
    Node curr = temp.next;
    temp.next=p;
    p=temp;
    temp=curr;
    }
    return p;

  • @gauravmishra8782
    @gauravmishra8782 6 місяців тому +11

    The dry run part is genius!! very nice explanation.

  • @1handclaps
    @1handclaps 4 місяці тому

    If you are a beginner or even an intermediate this is the best playlist to follow for DSA

  • @FifthArima
    @FifthArima 2 місяці тому +3

    The way he explains sounds like Arnab Goswami highlighting the news ! 😂

  • @raghavgarg-oo6mx
    @raghavgarg-oo6mx 5 місяців тому +1

    explanation of the recursive approach was just exceptional .
    thankyouu striver

  • @MrRon-jx9vx
    @MrRon-jx9vx 3 місяці тому +1

    Great explanation!!! The best i've ever seen on recursion !

  • @ritikshandilya7075
    @ritikshandilya7075 3 місяці тому

    Recursion approach is just LIT , bhai kamal kr diya striver bhai

  • @surge3.14
    @surge3.14 2 місяці тому

    Your DryRun thing in these recursion approaches is amazing

  • @amitarya4894
    @amitarya4894 5 днів тому

    Awesome and hats off 🙏🙏
    thank you so much Striver.

  • @harshilpatel3205
    @harshilpatel3205 5 місяців тому +1

    Amazing explanation at recursive approach thank you striver for this amazing course😊🎉

  • @ddevarapaga5134
    @ddevarapaga5134 24 дні тому

    Brooo u are crazyyyy that dry run is the best i have seen thank you understood

  • @ujjwalsingh6889
    @ujjwalsingh6889 4 місяці тому

    Finally I understood this recursive concept.........Nice Explanation👍👍

  • @prathambhatia3040
    @prathambhatia3040 12 днів тому

    Thanks for that dry run approach

  • @rahuldwivedi4758
    @rahuldwivedi4758 7 місяців тому

    Even more concise:
    function reverseList(head, prev=null){
    if(head === null) return prev;
    const next = head.next;
    head.next = prev;
    return reverseList(head.next, head);
    }

  • @HemangSinghal-op5ep
    @HemangSinghal-op5ep 3 дні тому

    Awesome Explanation!

  • @honeyjot8709
    @honeyjot8709 5 місяців тому

    Loved the explanation for recursive solution, especially the DRY RUN

  • @mohitparmar01
    @mohitparmar01 18 днів тому

    best explanation ever!

  • @swathigp3818
    @swathigp3818 2 місяці тому

    I was very confused with this recursive method, how does it reverse. It is super clear after watching your video !

  • @kalpking...4496
    @kalpking...4496 5 місяців тому +1

    understood very much
    thank you sir

  • @user-bc6ss6gp3z
    @user-bc6ss6gp3z 5 місяців тому

    Amazingly explained, #Striver rocks, gold bless you & all

  • @bhusanrath9698
    @bhusanrath9698 2 місяці тому

    0:00 -4:58 = Brute Force (Using Stack)
    5:00 - 14:45 = Iterative
    14:50 = Recursive

  • @stith_pragya
    @stith_pragya 6 місяців тому

    UNDERSTOOD, Thank You So Much for this wonderful video...........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @lakshayverma6557
    @lakshayverma6557 Місяць тому

    dry run was awesome

  • @AbhishekKumar-cd4gg
    @AbhishekKumar-cd4gg Місяць тому

    understood , best part was dry run of recursive code

  • @girirajsingh4467
    @girirajsingh4467 Місяць тому +1

    you are a genius

  • @_thingsthatmatter
    @_thingsthatmatter Місяць тому

    i love youuuu u r thee besttttt teacherrrrrrrr EVERRRRRRRRRRRRR

  • @swagatrout3075
    @swagatrout3075 6 місяців тому

    thank you man tanks for clarifying the recursion from scratch

  • @nuraynasirzade
    @nuraynasirzade 3 місяці тому +1

    Striver i'm solving A2Z course and i'm at the strings but there is no video explanation for them. i searched videos on youtube but one explains in detail and clear like you. So can you PLEASE make videos on that topic(i will wait). Thank You

  • @adharapuramnavaneeth9925
    @adharapuramnavaneeth9925 7 місяців тому +1

    greatest video superb sir !!

  • @ankithazra2005
    @ankithazra2005 Місяць тому +2

    you are god

  • @hiteshsharma9192
    @hiteshsharma9192 7 місяців тому

    Broo your way of explaining is awesom👍👍

  • @amanpratapsingh1981
    @amanpratapsingh1981 8 місяців тому +3

    Hey, I find your videos very valuable interms of understanding things, but just not able to find the links in the description whatever you mention in the video, not sure why.
    Thanks Striver for these videos.

    • @sarthakkk8628
      @sarthakkk8628 7 місяців тому

      you can find the links on his website whose link is in the description.

  • @MayankisG
    @MayankisG 14 днів тому +1

    Understood

  • @annapureddyravi4054
    @annapureddyravi4054 3 місяці тому

    Bro can you push the code ..The way you explain is very interesting to watch and learn the concepts.

  • @Ammmmmmmman
    @Ammmmmmmman 6 місяців тому

    Dry run part was actually brilliant

  • @ManasNandMohan
    @ManasNandMohan 7 місяців тому +1

    So Beautiful , So elegant just looking like a WoW

  • @knowthrvdo
    @knowthrvdo 5 місяців тому

    NICE LECTURE AND PLZ UPLOAD REMAINING LECTURES OF A TO Z SDA SHEET PLZ THEY ARE VERY HELPFULL FOR US

  • @aavashkuikel1341
    @aavashkuikel1341 3 місяці тому

    15:00 Recursion Starts

  • @pradipthij3552
    @pradipthij3552 2 місяці тому

    best explanation ever

  • @kumarnishantnitallahabad160
    @kumarnishantnitallahabad160 2 місяці тому

    Wow great explanation

  • @hashcodez757
    @hashcodez757 Місяць тому

    9:45 Take U Forward

  • @instinct1098
    @instinct1098 2 місяці тому

    Recursive is damnn good!!

  • @sibiranganath
    @sibiranganath 3 місяці тому

    Recursive approach: 14:50

  • @rockstarCoolz
    @rockstarCoolz 2 місяці тому

    Thanks 🙏 sir

  • @khalasianiket816
    @khalasianiket816 Місяць тому

    understood ❤

  • @prathameshjadhav2942
    @prathameshjadhav2942 7 місяців тому

    Awesome teaching

  • @adebisisheriff159
    @adebisisheriff159 6 місяців тому

    Simply the best!!!

  • @ojasviagrawal3180
    @ojasviagrawal3180 8 місяців тому

    excellent explanation was just fabbb

  • @saitehith6647
    @saitehith6647 4 місяці тому

    Just Brilliant ❤

  • @pavanKumar-hm7on
    @pavanKumar-hm7on 6 місяців тому

    you are our god . thank you soo much

  • @bushrahussain3005
    @bushrahussain3005 4 місяці тому +1

    Which process is the best you have to explain in 1 min through time n space complexity steps in the end which you didn't

  • @rishu4800
    @rishu4800 7 місяців тому

    Amazing explanation

  • @pankajsunal9819
    @pankajsunal9819 5 місяців тому

    thanks for this explanation

  • @user-pc5gs7ru5o
    @user-pc5gs7ru5o 8 місяців тому

    Best video explanation

  • @Arnavfellasleep
    @Arnavfellasleep 4 місяці тому

    Understood
    Will comeback after a month and report where I am.

  • @sumit2080
    @sumit2080 20 днів тому

    understood

  • @codeman3828
    @codeman3828 6 місяців тому

    Great video

  • @gauravbanerjee2898
    @gauravbanerjee2898 6 місяців тому

    Understood Thanks a lot ❣❣

  • @banothutharun2743
    @banothutharun2743 5 місяців тому

    what a man 👏👏

  • @user-dv1ts9db8i
    @user-dv1ts9db8i 6 місяців тому

    UNDERSTOOD SIR

  • @diptamo
    @diptamo 7 місяців тому

    bhaiyaa app great ho❤❤❤❤

  • @user-tk2vg5jt3l
    @user-tk2vg5jt3l 5 місяців тому

    Thank you bhaiya

  • @justvibin6601
    @justvibin6601 2 місяці тому

    Amazing !!!

  • @adithyahegdekota2586
    @adithyahegdekota2586 29 днів тому

    14:!4 The death stare

  • @manga_mania.
    @manga_mania. 8 місяців тому

    Thank you striver😃😃

  • @thenarmada007
    @thenarmada007 3 місяці тому

    Man, I must say, wonderful video. You explained the recursive solution so well 🤌. I have a much deeper understanding of how to deal with recursion in general because of you. Usually, in recursion people skip through the nitty-gritty details like the current state of the variables involved and the structure of the linked list in intermediate steps, but you have gone through all of it, so thanks! Hope you get more views and subscribers.

  • @YourCodeVerse
    @YourCodeVerse 6 місяців тому

    Understood✅🔥🔥

  • @s.saranya2486
    @s.saranya2486 7 місяців тому

    the BEST💯

  • @user-or5oz1pk2x
    @user-or5oz1pk2x 4 місяці тому

    Thanks A lot

  • @snehashisratna9074
    @snehashisratna9074 8 місяців тому

    big fan bhai luv you bhai

  • @CoderGrow1
    @CoderGrow1 4 місяці тому

    understand

  • @ArpanChakraborty-do6yz
    @ArpanChakraborty-do6yz 5 місяців тому

    Understand ❤❤

  • @surayahappy120
    @surayahappy120 8 місяців тому

    best best best best ...................................................................

  • @Ashutoshkumar-jx9wk
    @Ashutoshkumar-jx9wk 7 місяців тому

    Thanks ❤

  • @whitedevil2869
    @whitedevil2869 8 днів тому

    In recursive way m..I wrote the same code given above ..... Stack overflow error aa raha hain ....give me soln

  • @NARUTOUZUMAKI-bk4nx
    @NARUTOUZUMAKI-bk4nx 6 місяців тому

    Understooood

  • @AnuragParoha-ck5ds
    @AnuragParoha-ck5ds 3 місяці тому

    understood!!!

  • @GGARIN.C.R
    @GGARIN.C.R Місяць тому +1

    20:04 check it out🤣

  • @subee128
    @subee128 8 місяців тому

    Thanks

  • @RituSingh-ne1mk
    @RituSingh-ne1mk 7 місяців тому

    Understood!

  • @codingalley6229
    @codingalley6229 Місяць тому

    🐐

  • @manasbhatia1191
    @manasbhatia1191 2 місяці тому +3

    Is it me or anyone else also thinks that things have been a little tougher from Linked List

    • @vibhavsharma2724
      @vibhavsharma2724 Місяць тому +1

      I think it's you only.

    • @aspirant500days7
      @aspirant500days7 Місяць тому +1

      No man. I've given up on Linked last multiple times to reach this far (not even half).

  • @Shivi32590
    @Shivi32590 2 місяці тому

    Thank you Sir.

  • @ashutosh61290
    @ashutosh61290 8 місяців тому +5

    bro is recording me aap bahut hi jyda tired dikh rhe ho.. aapko ek acche neend ki jrurat hai..

    • @takeUforward
      @takeUforward  8 місяців тому +12

      Pdhai kar lo, meko dekh kr kya hoga 🤦🏼‍♂️

    • @aasimahsan6167
      @aasimahsan6167 8 місяців тому

      @@takeUforward 😂

    • @vatsaljain662
      @vatsaljain662 8 місяців тому

      @@takeUforward Thank You for your Hardwork Bhaiya

    • @AbhishekKumar-nz9dn
      @AbhishekKumar-nz9dn 7 місяців тому

      @@takeUforward 😂jainwin

  • @GADDAMSAHITHYAKUMARRAJA
    @GADDAMSAHITHYAKUMARRAJA 2 місяці тому

    why can't we just change the head rather than using temporary node and then return the head;

  • @Anime-ub7vs
    @Anime-ub7vs 6 місяців тому

    recursive solution of linked list
    ListNode* reverseList(ListNode* head) {
    if(head == NULL) return NULL ;
    if(head->next == NULL ) return head ;
    ListNode * newHead = reverseList(head->next);
    head->next->next = head ;
    head->next = NULL;
    return newHead ;
    }

  • @utpalkant6354
    @utpalkant6354 5 місяців тому +2

    Bhai mere college ke professors ko nikal do, Raj bhai ko HOD bana do.

  • @shreyanshvijoy4786
    @shreyanshvijoy4786 6 місяців тому

    Fab

  • @anupkhismatrao9280
    @anupkhismatrao9280 6 місяців тому