L4. Reverse a DLL | Multiple Approaches

Problem Link: tinyurl.com/mw45vuf6
Entire LL Sheet: takeuforward.org/linked-list/...
Check our A2Z DSA Course: takeuforward.org/strivers-a2z...
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/takeuforward

Пікірлер: 65

  • @purushottam108
    @purushottam10824 күн бұрын

    17:21 "And the interviewer will hire you,no worry" best part🤑🤑🥰🥰

  • @Thunder97654

    @Thunder97654

    19 күн бұрын

    😂

  • @qihse1531
    @qihse15317 ай бұрын

    This simple problem is insanely hard to me...thank you Striver!!

  • @harshitgarg2820
    @harshitgarg28207 ай бұрын

    Loved your dedication sir, completed this ques and loving this series like all others. Top-tier content🔥🔥

  • @keshavchoudhary8857
    @keshavchoudhary88575 ай бұрын

    this type of great content cannot be found elsewhere , Excellent!!!

  • @hermionegranger7443

    @hermionegranger7443

    5 ай бұрын

    Is kunal kushwaha better or this one?

  • @Ayush37262

    @Ayush37262

    4 ай бұрын

    ​@@hermionegranger7443I think Striver, Kunal is more into Controversies

  • @Sunny-hg5oe
    @Sunny-hg5oe2 ай бұрын

    Great thought of using the stacks!!!!

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

    instead of using next ad back which is a bit ambiguous you could've used next and previous ( prev ) which will be more understandable

  • @itsorcus649

    @itsorcus649

    Күн бұрын

    🤓

  • @RRR-qv1so
    @RRR-qv1so7 ай бұрын

    Thank you for this amazing playlist bhaiya ❤❤

  • @user-jw2sz7in7x
    @user-jw2sz7in7x7 ай бұрын

    you are the boss .. please make a playlist about competitive programming.

  • @adebisisheriff159
    @adebisisheriff1595 ай бұрын

    Thanks Striver!!!

  • @shubhamanand8557
    @shubhamanand85573 ай бұрын

    It really helps me to understand in a very easy manner. Thanks a lot bhaiya.

  • @BeWarrior-dw4br
    @BeWarrior-dw4br6 ай бұрын

    The takeuforward website is not loading .. I'm trying to access the A2Z sheet for the last three days but it is not working.

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

    great work and thank you !

  • @TON-108
    @TON-1086 ай бұрын

    Understood!!! Thank You.......

  • @Vvvvviieiei123
    @Vvvvviieiei1237 ай бұрын

    lecture 4 done,love u bhaiya

  • @chetashreejagtap7585
    @chetashreejagtap75857 ай бұрын

    thank you striver👍👍

  • @guneeshvats46
    @guneeshvats4624 күн бұрын

    Dude your lectures are amazing

  • @NazeerBashaShaik
    @NazeerBashaShaik2 ай бұрын

    Understood, thank you.

  • @AmanSharma-xy1qm
    @AmanSharma-xy1qm7 ай бұрын

    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.

  • @vaibhavvm4147

    @vaibhavvm4147

    5 ай бұрын

    Bro how do u approach DSA, do u first watch videos and then solve it on ur own or how?

  • @AmanSharma-xy1qm

    @AmanSharma-xy1qm

    5 ай бұрын

    initially, i learn first the therory part like methods that are used in this, and i usually watch Striver's playlist of that topic , and learn the patterns of the questions then i go to leetcode and gfg and solve same patterns problems. With the approaches i learned from Striver. That's all. Hope you got this.@@vaibhavvm4147

  • @Rahul_Mongia

    @Rahul_Mongia

    3 ай бұрын

    @@vaibhavvm4147 video dekh le bhai, dimag khol......., phir related ques khud try kar

  • @user-ok6km9me6x
    @user-ok6km9me6x3 ай бұрын

    Thank You Bhaiya.

  • @ankit-jangid
    @ankit-jangid6 ай бұрын

    nice explanation brother, 1 thing I'd like to advice is please use the same variable names while coding which you use while explaining, it would be helpful. Good work and your videos are great!!✌🏻😇 thanks

  • @YourCodeVerse
    @YourCodeVerse5 ай бұрын

    Understood✅🔥🔥

  • @pratyushtripathi1728
    @pratyushtripathi17286 ай бұрын

    Understood 😊

  • @Ergoswami
    @Ergoswami3 ай бұрын

    Completed!

  • @subee128
    @subee1287 ай бұрын

    Thanks

  • @user-uv5or5bm2c
    @user-uv5or5bm2c23 күн бұрын

    Understood !!

  • @tle964
    @tle96419 күн бұрын

    nice video

  • @khalasianiket816
    @khalasianiket8167 күн бұрын

    understood ❤

  • @rizonkumarrahi
    @rizonkumarrahi7 ай бұрын

    Great

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

    Understood!

  • @r_uhi05
    @r_uhi053 ай бұрын

    understood!

  • @harshuke5831
    @harshuke58317 ай бұрын

    Understood

  • @lifehustlers164
    @lifehustlers1646 ай бұрын

    17:20 , dream come true!!!

  • @firebout7675
    @firebout76753 ай бұрын

    understood

  • @user-di7cc8jp1w
    @user-di7cc8jp1w5 ай бұрын

    nice

  • @Zomb-zj4ip
    @Zomb-zj4ip21 күн бұрын

    understooooooooooooood

  • @sumitworld918
    @sumitworld9182 ай бұрын

    Undertood 😌

  • @harshitjaiswal9439
    @harshitjaiswal94395 ай бұрын

    🔥🔥🔥

  • @himanshukaushik9223
    @himanshukaushik92236 ай бұрын

    Bhaiya 0(1) ma bhi solution hai kya iska ??

  • @aaryangupta4505
    @aaryangupta45056 ай бұрын

    if(head==NULL||head->next==NULL) return head; Node* temp = NULL; Node* curr = head; while (curr != NULL) { curr->prev = curr->next; curr->next = temp; temp=curr; curr = curr->prev; } return temp;

  • @gourabrajak8132
    @gourabrajak81324 ай бұрын

    👍😊

  • @vishious14
    @vishious145 ай бұрын

    My approach looks something like this: Publlic class Solution{ public static Node reverseDLL(Node head) { Node p=null,curr=null,f=head; while(f!=null){ p = curr; curr = f; f=f.next; curr.next = p; if(p!=null) p.prev = curr; } head = curr; return head; } }

  • @UjjwalMishra-xf9un
    @UjjwalMishra-xf9un15 күн бұрын

    why this code is not working,, its all same just using one extra variable; Node* reverseDLL(Node* head) { if(head==nullptr || head->next==nullptr)return head; Node * current=head; Node *back=nullptr; Node *front=nullptr; Node *temp=nullptr; while(current){ back=current->prev; front=current->next; temp=back; back=front; front=temp; current=current->prev; } return back->prev; }

  • @user-ke7fs7ds6h
    @user-ke7fs7ds6h6 ай бұрын

    striver is best

  • @user-ud2mb7lk6q
    @user-ud2mb7lk6q6 ай бұрын

    If we point the head to last node, the behaviour would be same as revered doubly Linked list right??? Why do we need to do these processing???

  • @techwithsam4302

    @techwithsam4302

    7 күн бұрын

    In that case we can't traverse in the forward direction instead we have to go backward to traverse!!

  • @TarunKumar-km5ps
    @TarunKumar-km5ps4 ай бұрын

    👌👌👌👌👌👌👌👌👌👌👌👌

  • @varun1017
    @varun10176 ай бұрын

    why this is correct and last=curr->prev; curr->prev=curr->next; curr->next=last; this is not working? last=curr->next; curr->next=curr->prev; curr->prev=last;

  • @user-gk4zy6bk7l
    @user-gk4zy6bk7l2 ай бұрын

    god

  • @charuprabha9696
    @charuprabha969611 күн бұрын

  • @Rohith__Dev
    @Rohith__Dev14 күн бұрын

    28-06-2024

  • @user-ns7tu5no1i
    @user-ns7tu5no1iАй бұрын

    class Solution { public: Node* reverseDLL(Node * head) { if(head == NULL || head->next == NULL) { return head; } Node* pichli = head; while(head->next != NULL) { pichli = head; head = head -> next; } Node*mover = head; mover->next = pichli; mover->prev = NULL; Node*back = mover; mover = mover->next; pichli = pichli->prev; while(pichli != NULL) { mover->prev = back; mover->next = pichli; back = mover; mover = mover->next; pichli = pichli->prev; } mover->next = NULL; mover->prev = back; return head; } }; this is i ve done but ur one is more intutive and easy also

  • @harshilpatel3205
    @harshilpatel32054 ай бұрын

    Understood 🫡

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

    Understood

  • @ashishpradhan6250
    @ashishpradhan625028 күн бұрын

    understood

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

    Understood

  • @himanshidafouty347
    @himanshidafouty34725 күн бұрын

    Understood

  • @ganeshvhatkar9253
    @ganeshvhatkar92535 ай бұрын

    Understood

  • @chiragbansod8252
    @chiragbansod82523 ай бұрын

    understood