Binary Tree to DLL | Flatten Binary Tree to Doubly Linked List | DSA-One Course #62

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 66

  • @AnujBhaiya
    @AnujBhaiya  2 роки тому +60

    Apologies for the delay in this video, I was working on an exciting new thing which we'll launch soon. Stay tuned and thanks for Supporting 🙌🏻

    • @oppoplayer7203
      @oppoplayer7203 2 роки тому +3

      Bhayia please launch c++ course and how can kids Learn programming and these platforms like whitehatjr are making fool to us by the name of coding

    • @mrrishiraj88
      @mrrishiraj88 2 роки тому +1

      No worries!
      We are sure that you always utilise time well.
      You take great care of our time as well as of your own time.
      Keep on earning love and achieving higher successes!
      👍👍

    • @SaurabhKumar-oz4gk
      @SaurabhKumar-oz4gk 2 роки тому +1

      Bhaiya ye dsa complete kab hogga??

    • @ismailhossain4730
      @ismailhossain4730 2 роки тому +1

      Finally after 2 weeks.... thanks for the tutorial. Love from 🇧🇩

    • @ashasaideepika1530
      @ashasaideepika1530 Рік тому

      bhaiya i tried this same code in leetcode but for one test case it is showing as found a cycle in the tree what should i do to resolve that issue

  • @kalpeshsharma3446
    @kalpeshsharma3446 2 роки тому +14

    For every question please give a short brief about iterative, recursively approach, time, space complexity and how much it can be optimize.

  • @codetochange8
    @codetochange8 2 роки тому +2

    Thanks Anuj Bhaiya for this amazing explanation...

  • @jayeshkaushik2975
    @jayeshkaushik2975 2 роки тому +3

    U r never too late bro, thanks for the intersting videos💯

  • @ShadabChoudhary-s8v
    @ShadabChoudhary-s8v 9 місяців тому

    Really nice and easy to understand approach

  • @sagarpanwar2724
    @sagarpanwar2724 10 місяців тому

    Very underrated video. But would have been better if the video contained code as well to cross check

  • @biswajitsaha6773
    @biswajitsaha6773 2 роки тому +1

    This is the best solution for Binary Tree to a Doubly Linked List conversion..thank you Anuj Bhaiya for the awesome explanation

  • @Sourabh__Chaurasiya
    @Sourabh__Chaurasiya 2 роки тому +3

    Ham to anee se hi khush hn

  • @prnk139
    @prnk139 2 роки тому +2

    good way of teaching!

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

    great explanation

  • @er.skelafahmed
    @er.skelafahmed 2 роки тому +1

    Eagerly waiting for this bhiya... Please upload 2 videos in a week atleast. Humble request 😀

  • @tallalhabib4526
    @tallalhabib4526 2 роки тому

    Excellent Demonstration

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

    Good explanation.

  • @chaitanyashekhardeo4269
    @chaitanyashekhardeo4269 2 роки тому +1

    Please jldi course complete kr do. Main aap hi per depend rehta

  • @jainikprajapati1632
    @jainikprajapati1632 2 роки тому +1

    Thank you for your efforts 😊
    Good video

  • @9-1939
    @9-1939 Рік тому

    That was very simple 👌🔥

  • @dongarevikramnarayan179
    @dongarevikramnarayan179 Рік тому

    nice explanation sir

  • @prnk139
    @prnk139 2 роки тому +2

    thanks for posting with such an amazing explanation!!

  • @ANKITCHAUHAN-do2ug
    @ANKITCHAUHAN-do2ug 2 роки тому

    thanx for the solution
    SO SIMPLE

  • @sidharthmak
    @sidharthmak Рік тому +3

    Appreciate the video, sir! But in the code you have written a void function but are returning a NULL value in base case. Would be great if you could correct that!

  • @atuldwivedi7677
    @atuldwivedi7677 2 роки тому

    Thanks a lot Bhaiya 🙏🙏

  • @laveshgarg2189
    @laveshgarg2189 2 роки тому

    Amazing video bhaiya maza aa gaya

  • @sriramulavenkatakrishnakar9615
    @sriramulavenkatakrishnakar9615 2 роки тому +2

    Happy ur return

  • @arshdeep011
    @arshdeep011 Рік тому

    thanks

  • @lofibeats2344
    @lofibeats2344 2 роки тому

    very well explained

  • @reenayadav8468
    @reenayadav8468 2 роки тому +1

    Atleast two video one week me upload karo please🙏🙏 it's my humble request sir

  • @sainath5131
    @sainath5131 2 роки тому

    Must watch video

  • @harshgarg594
    @harshgarg594 2 роки тому

    Great content in free
    Thanks bhaiya

  • @unknown30778
    @unknown30778 Рік тому +1

    Make more vedio on tree and graph

  • @Manojkumar15629
    @Manojkumar15629 2 роки тому

    Love you bhaiya ❣️

  • @rishikeshkumar8652
    @rishikeshkumar8652 2 роки тому +1

    Here the binary tree is converted to Doubly linked list in inorder fashion but can we convert it to doubly linked list of pre-order and post-order fashion ? I cannot find the code for the above two ....

  • @sagarsondur
    @sagarsondur 2 роки тому

    Bhaiya is back!!

  • @prnk139
    @prnk139 2 роки тому

    it is really nice but try to include complexity analyis in the video!

  • @Explore_with_anish
    @Explore_with_anish 2 роки тому +4

    Bro... return type is void but you vare returning null ....it should be only return.

    • @PankajSingh-vi3fy
      @PankajSingh-vi3fy 2 роки тому +1

      Exactly... for that you've to pass the prev variable to the recursive function

  • @sriramulavenkatakrishnakar9615
    @sriramulavenkatakrishnakar9615 2 роки тому +1

    @anuj bhaiyya

  • @pinkkitty6553
    @pinkkitty6553 Рік тому

    void method par null kese return kar sakte hai ??

  • @FunnyGamerNo1
    @FunnyGamerNo1 2 роки тому

    class Solution
    {
    //Function to convert binary tree to doubly linked list and return it.
    Node head, prev;
    Node bToDLL(Node root)
    {
    if(root==null) return null;
    bToDLL(root.left);
    if(prev==null){
    head=root;
    prev=root;
    // prev=root;
    }
    else
    {
    prev.right=root;
    root.left=prev;
    prev=root;
    }
    bToDLL(root.right);
    return head;
    }
    }

  • @bharatns598
    @bharatns598 2 роки тому +1

    What is root.left why we using

  • @snehaltripathi5763
    @snehaltripathi5763 Рік тому

    GFG solution :
    class Solution
    {
    Node*head = NULL;
    Node*prev=NULL;
    private:
    void convertToDLL(Node*root)
    {
    if(root==NULL) return;
    convertToDLL(root->left);
    if(prev==NULL) head = root;
    else
    {
    root->left = prev;
    prev->right = root;
    }
    prev=root;
    convertToDLL(root->right);
    }

    public:
    //Function to convert binary tree to doubly linked list and return it.
    Node * bToDLL(Node *root)
    {
    if(root==NULL ) return NULL;
    convertToDLL(root);
    return head;
    }
    };

  • @KittyMaheshwari
    @KittyMaheshwari 2 роки тому

    "bohot easy hai"

  • @neelamjoon5095
    @neelamjoon5095 Рік тому

    but how to print that list now??

  • @sumitkanth5349
    @sumitkanth5349 2 роки тому

    Gsoc 2022 pr video bnao from scratch Plzzzz..... Mujhe Javascript aati h

  • @Adity853
    @Adity853 Рік тому

    Sir yh code run hi nhi kr rha
    Aspke karaye huye mostly code run nhi krte

    • @Adity853
      @Adity853 Рік тому

      Khi na khi error aa hi rhi h

  • @baldevgogalyofficial3217
    @baldevgogalyofficial3217 2 роки тому

    Void mein aap null return kyun kr rhe ho
    'error aa rha h , code run nhi kr rha

  • @arpanmaheshwari2290
    @arpanmaheshwari2290 2 роки тому +1

    Hum first

  • @sudeeptaadas03
    @sudeeptaadas03 2 роки тому

    Where can I solve questions on DSA?

  • @good114
    @good114 Рік тому

    💕❤️❤️💕

  • @ARS_DEVELOPER
    @ARS_DEVELOPER 2 роки тому +1

    Damn this copyright claim 😑

  • @shivanshupandey3637
    @shivanshupandey3637 Рік тому

    ❣❣❣❣❣❣❣❣❣

  • @sriramulavenkatakrishnakar9615
    @sriramulavenkatakrishnakar9615 2 роки тому +2

    @anuj Bhaiya

  • @unknown30778
    @unknown30778 Рік тому

    Make more vedio of tree and graph

  • @unknown30778
    @unknown30778 Рік тому

    Make more vedio of tree and graph

  • @unknown30778
    @unknown30778 Рік тому

    Make more vedio of tree and graph

  • @unknown30778
    @unknown30778 Рік тому

    Make more vedio of tree and graph