Add One Row to Tree | Live Coding with Explanation | Leetcode - 623

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 12

  • @AlgorithmsMadeEasy
    @AlgorithmsMadeEasy  3 ปีที่แล้ว +4

    We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!!
    Questions you might like:
    ✅✅✅[ Tree Data Structure ] : th-cam.com/play/PLJtzaiEpVo2zx-rCqLMmcFEpZw1UpGWls.html
    ✅✅✅[ Graphs Data Structure ] : th-cam.com/play/PLJtzaiEpVo2xg89cZzZCHqX03a1Vb6w7C.html
    ✅✅✅[ February Leetcoding Challenge ] : th-cam.com/play/PLJtzaiEpVo2wrfvII0eZQsPm-MZCmHodm.html
    ✅✅✅[ January Leetcoding Challenge ] : th-cam.com/play/PLJtzaiEpVo2wCalBcRcNjXQ0C6ku3dRkn.html
    ✅✅✅[ December Leetcoding Challenge ] : th-cam.com/play/PLJtzaiEpVo2xo8OdPZxrpybGR8FmzZpCA.html
    ✅✅✅[ November Leetcoding Challenge ] : th-cam.com/play/PLJtzaiEpVo2yMYz5RPH6pfB0wNnwWsK7e.html
    ✅✅✅[ August Leetcoding Challenge ] : th-cam.com/play/PLJtzaiEpVo2xu4h0gYQzvOMboclK_pZMe.html
    ✅✅✅July Leetcoding challenges: th-cam.com/play/PLJtzaiEpVo2wrUwkvexbC-vbUqVIy7qC-.html
    ✅✅✅June Leetcoding challenges: th-cam.com/play/PLJtzaiEpVo2xIfpptnCvUtKrUcod2zAKG.html
    ✅✅✅May Leetcoding challenges: th-cam.com/play/PLJtzaiEpVo2wRmUCq96zsUwOVD6p66K9e.html
    ✅✅✅Cracking the Coding Interview - Unique String: th-cam.com/play/PLJtzaiEpVo2xXf4LZb3y_BopOnLC1L4mE.html
    Struggling in a question??
    Leave in a comment and we will make a video!!!🙂🙂🙂

  • @ShubhamSharma-sf8wk
    @ShubhamSharma-sf8wk 7 หลายเดือนก่อน +1

    Simplest explanation available on the internet.

  • @shreyansh3862
    @shreyansh3862 2 ปีที่แล้ว +1

    amazing explanation...
    I really like the animation

  • @astronautatul
    @astronautatul 2 ปีที่แล้ว +1

    Great Explanation ....:)

  • @mohammadyahya78
    @mohammadyahya78 3 ปีที่แล้ว

    Amazing explanation. Thank you.

  • @abhisheksuryavanshi9675
    @abhisheksuryavanshi9675 3 ปีที่แล้ว +1

    Great job!

  • @CRamPrasannaCV
    @CRamPrasannaCV 3 ปีที่แล้ว

    Understood :-)

  • @ankurpurohit5091
    @ankurpurohit5091 ปีที่แล้ว

    TreeNode* addOneRow(TreeNode* root, int val, int depth, int l = 1) {
    if(depth == 1){
    TreeNode* newroot = new TreeNode(val);
    if(l)
    newroot->left = root;
    else
    newroot->right = root;
    return newroot;
    }
    if(root){
    root->left = addOneRow(root->left, val, depth-1, 1);
    root->right = addOneRow(root->right, val, depth-1, 0);
    }
    return root;
    }