Data structures: Binary Tree

Поділитися
Вставка
  • Опубліковано 16 січ 2014
  • See complete series on data structures here:
    • Data structures
    In this lesson, we have discussed binary tree in detail. We have talked about different types of binary tree like "complete binary tree", "perfect binary tree" and "balanced binary tree" and their properties. We have also discussed how cost of operations in a tree may depend upon height of the tree and why we want a tree to be dense and its height to be minimum. Finally, we talked about two possible implementations of binary tree - a) using dynamically created nodes and b) using arrays.
    For practice problems and more, visit: www.mycodeschool.com
    Like us on Facebook: / mycodeschool
    Follow us on twitter: / mycodeschool

КОМЕНТАРІ • 382

  • @saikumar555
    @saikumar555 4 роки тому +383

    Felt very sad that the guy who was founder of these courses passed away on June 2014 . in a car accident! but he is alive with his videos!!! RIP !! :(

    • @nicolasgoosen5142
      @nicolasgoosen5142 3 роки тому +12

      Yes, they're fantastically dense full of info and comprehensive.

    • @aakashdharmakari2591
      @aakashdharmakari2591 3 роки тому +8

      how do you know this? who is running the channel now, cuz the last video on this channel is 4 years old.... please reply I really wanna know the answers.....

    • @findoc9282
      @findoc9282 3 роки тому +3

      he always live in our heart, never be forgot. Every moment we get inspired in some moment in the future

    • @rchtchauhan
      @rchtchauhan 3 роки тому +6

      @@qq3801 thanks buddy for this

    • @MinaTheSmallYoutuber
      @MinaTheSmallYoutuber 3 роки тому +3

      sad to hear that. RIP

  • @eshaan7_
    @eshaan7_ 5 років тому +427

    If anyone is having confusion between depth and height, think of the analogy that we measure the 'depth' of sea from it's surface and the 'height' of a person from toe to head.
    PS: This was taken from a stackoverflow thread.

    • @nareshramini1796
      @nareshramini1796 4 роки тому +9

      I'm still confused about height and depth of a tree!

    • @satyajitchandankar418
      @satyajitchandankar418 4 роки тому +4

      what do you mean!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

    • @thewatcherlollol
      @thewatcherlollol 4 роки тому +3

      stole this right off of Stackoverflow. Credit the person smh.

    • @dhruvgaba8516
      @dhruvgaba8516 4 роки тому +38

      Let's imagine an example of a fish swimming in the sea. Here, fish resembles a node, and the height of the fish from the sea bed resembles the height of the node and the depth of the fish from the surface of the sea resembles the depth of the node.
      Have a look at the diagram below:
      _ _ _ _ _ _ _ _ _ _ _ _ _ == surface (root node)
      |
      | == Depth from the surface of the sea (if there are d no. of edges to get to node x)
      |
      ((*)) === Fish Any particular node (x)
      |
      | == Height from the bottom of the sea (if there are h no. of edges from the bottom-most leaf)
      |
      _ _ _ _ _ _ _ _ _ _ _ _ _ == sea bed (leaves, end of tree)

    • @akshaysolanki4340
      @akshaysolanki4340 4 роки тому

      Eshaan thanks for sharing

  • @TheTahlia1988
    @TheTahlia1988 8 років тому +39

    I cannot thank you enough for this playlist on Data Structures! Keep up the good work :)

  • @yashchandraverma3131
    @yashchandraverma3131 6 років тому +168

    I click on every ads that you show because you are teaching me well and it is my duty to give some money from ads to you. Thanks mycodeschool.

    • @blackflame_
      @blackflame_ 5 років тому +6

      He passed away..

    • @lyfokzz3848
      @lyfokzz3848 5 років тому +8

      @@blackflame_ his friend passed away...

    • @blackflame_
      @blackflame_ 5 років тому

      @@lyfokzz3848 Whoever he was I owe him for helping me clear my courses

    • @lyfokzz3848
      @lyfokzz3848 5 років тому +2

      @@blackflame_ yup...some of the real IT/CS people will understand his work!

    • @shahriarmim4696
      @shahriarmim4696 5 років тому +2

      It's the cofounder Animesh Nayan. And I think he doesn't need anyone's money. And death happened to Late Harsha who was also a managing member of MyCodeSchool. Read this: blog.mycodeschool.com/2013/12/the-story-of-mycodeschool.html?view=classic

  • @learningisjoy8613
    @learningisjoy8613 9 років тому +342

    Thanks for your hardwork...you did awesome job that benefit many students like me...Thumbs up and keep on sharing.

  • @sourabhdattawad9244
    @sourabhdattawad9244 8 років тому +38

    Best data structures tutorial around the web. Thanks for enlightening!

  • @josedubois2295
    @josedubois2295 8 років тому +21

    You are an amazing teacher thank you so much for helping me understand these topics more completely.

  • @akumasdeception
    @akumasdeception 3 роки тому +8

    This is a masterpiece, thank you so much for the job that you're doing!

  • @mycodeschool
    @mycodeschool  10 років тому +67

    Here is the next video - Data structures: Binary Search Tree

    • @nishant73391
      @nishant73391 8 років тому +7

      +mycodeschool at 13:20 you show the height of the left child of root is 2. The height of left child of 2 is 0 here not 1. so how the height is 2?

    • @sambitsarkar6987
      @sambitsarkar6987 8 років тому +4

      +NISHANT NIKET You are right. The height of the left child of 2 is 1 and not 0. But we are talking about the abs difference between the height of left and right sub tree. So, lheight = 1, Rheight = 1, lheight - Rheight = 0.
      Hope this helps!!

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

      I have been watching this video since 2015 and I never get tired even on this 2019. Thank you so much for this wonderful work.

    • @rohithpokala
      @rohithpokala 4 роки тому

      @@cafafans me too

    • @DOOREO
      @DOOREO 4 роки тому

      mycodeschool ahhhhh.. I see!! *pointer to “the next video”...... GENIUS teachings

  • @nicolasgoosen5142
    @nicolasgoosen5142 3 роки тому +6

    This is an awesome series - even 7 years later!

  • @renon3359
    @renon3359 5 років тому +2

    Hands down best videos on the net for Data Structure. Awesome work man.

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

    oh my god this was so helpful. i've read so much content about trees and watched so many videos that always left me even more confused. But THIS ... this was just perfect and extremely well explained. thank you so much for making this video.

  • @anurakboonyaritpanit9129
    @anurakboonyaritpanit9129 9 років тому +4

    thank you mycodeschool
    for good and free video tutorial.
    it is a complete data structure. help me understand outside my class.

  • @rajatnarlawar
    @rajatnarlawar 8 років тому +14

    u teach very well...finding it easy cuz of u..:)

  • @asishraz6173
    @asishraz6173 4 роки тому +1

    Lots and lots of information in just one video. Thank you so much for your effort and dedication towards sharing this valuable piece of information. Keep up the great work.

  • @aditipatil7377
    @aditipatil7377 8 років тому +8

    hats off to u sir ! ur videos r life savers ! helped me alot during my dsa viva !!
    u r truly great teacher ! :))

  • @krishnasingh4434
    @krishnasingh4434 3 роки тому

    Sir you are the best teacher I have seen on UA-cam you teach in such a simple way 🙏

  • @khubaibraza8446
    @khubaibraza8446 7 років тому

    Best teacher of data Structure I have ever seeen .. Salute your efforts and hardwork ...

  • @georgioskyritsis2929
    @georgioskyritsis2929 9 років тому +4

    The best explanation i've ever seen. Thank you!

  • @premalathak6748
    @premalathak6748 9 років тому +2

    Thank you so much for wonderful video with the subtitles. Finally,now i can understand what a binary tree is.

  • @mxkep
    @mxkep 7 років тому +1

    All your data structures videos are great ! Thank you so much!

  • @vivekk232
    @vivekk232 7 років тому +4

    excellent sir....& lots of thanks to help me as such easy language to learn tree...I appreciate u sir

  • @Dylanbforthree
    @Dylanbforthree 9 років тому +1

    Awesome videos, keep up with adding the captions please!!! Makes it so easy to follow along, great tutorial!

  • @mayankpratapsingh5256
    @mayankpratapsingh5256 9 років тому +2

    mycodeschool is doing an awesome work.... Keep going ..

  • @1276stella
    @1276stella 9 років тому

    Thank you for your videos! I learn a lot from them and I will continue watching.

  • @WiseFatOwl
    @WiseFatOwl 5 років тому +3

    Thanks a lot for this data structure playlist! A life saver if u ask me..
    I know I know i'm pretty late.. but still thanks again!

  • @saikumarnallagangula
    @saikumarnallagangula 10 років тому +1

    thank you so much for the videos. I have never thought that I would learn DataStructures with so ease. Really loved each and every video(content, concepts and the way of teaching). Eagerly waiting for other Concepts of DataStructure and Specially Trees and Graphs. Hope you would continue with many more.

    • @ajaytillu
      @ajaytillu 10 років тому

      rey bujji chadavalekapothunnam ra

  • @hitesh123ism
    @hitesh123ism 5 років тому +1

    Best lecture on a binary tree so far.

  • @abhilashbss9059
    @abhilashbss9059 8 років тому +2

    fantastic work .... very easy n smooth take over

  • @ayushgp1
    @ayushgp1 9 років тому

    Awesome Channel! This is the best explaination i came across atleast for linked lists!

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

    This was a mind-blowingly good video! Glad I decided to redo my math as I started watching the first videos of this playlist. Knew it would come in handy. I'm very thankful these videos were made, and wish their creator was still alive to see how many people they help.

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

      Can you pls tell me what math do I need to learn to be able to understand this? Your answer would really help me

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

      @@paula19335 Just regular high school math. Exponents, square roots, logarithms. It's nit so much about a very specific part of it as it is about observing and applying mathematical thinking.

  • @VIKASHKUMAR-qt7pk
    @VIKASHKUMAR-qt7pk 4 роки тому +1

    thanks to making such a nice tutorial it will covers all necessary information to starting binary tree.
    thanks again.

  • @PratikShende91
    @PratikShende91 10 років тому

    realy helpin in improvin concepts.....voice is clear ...
    thanks for the videos...learnin DS with ease.

  • @TheSteak1984
    @TheSteak1984 9 років тому +5

    Great tutorials. Thank you.

  • @md-ayaz
    @md-ayaz 8 років тому +24

    Instead of thanking him on comment section. You could white list his channel on Ad-block ( if you are using one).

  • @ashfaqtunio1311
    @ashfaqtunio1311 7 років тому +2

    Excellent! Explained very well. Thanks for these videos

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

    Excellent even after 5 years..Thank you

  • @GauravSehrawat8888
    @GauravSehrawat8888 10 років тому +2

    Just too Good.. Awesome concepts .
    Channel will be popular soon !!

  • @JeshOrquina
    @JeshOrquina 9 років тому +1

    Do you have any tutorials on threaded binary trees? Is there any possibility you could make one? I have trouble understanding it in class and your tutorials have been very useful to me so it would be great if you could make one. Thanks!

  • @souravpati2007
    @souravpati2007 10 років тому

    Your explanation is clear and adequate , is it possible to discuss the implementation in java ? especially implementing the linked list class. Thanks !

  • @ewanmcdonnell6990
    @ewanmcdonnell6990 9 років тому +3

    Thank you for your good explanation.

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 3 роки тому

    tree can be implemented using arrays if tree is perfect binary tree not just complete .
    and your are one of the best in cs topics on the entire internet ,keep uppp

  • @shreyashjoshi4188
    @shreyashjoshi4188 5 років тому

    Your tutorials are just awesome man.

  • @qaziahmed9850
    @qaziahmed9850 8 років тому +2

    Thanks a lot sir yoh have good job and great effect in this way to help students whose want to increase the knoweldge wd conpect.

  • @kookiespace
    @kookiespace 9 років тому

    Your videos are amazing!

  • @docuscientifique
    @docuscientifique 10 років тому +5

    You saved my life :) I love you :)

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

    Guys there also exists a different version
    ACBT = Complete Binary Tree of mycodeschool
    Complete BT = Perfect Binary Tree of mycodeschool
    While Full/Strict/Proper and Perfect BT all are same.

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

    Hi. I am one of your subscriber, been following you for a couple of months. Can i possibly use this as a reference in our class, seems like you do have a very clear way of explaining. Thankyouuu.

  • @OmarFaruk-nw7rq
    @OmarFaruk-nw7rq 6 років тому

    the series in the description is very helpful . thanks

  • @attamalik6360
    @attamalik6360 8 років тому +1

    awesome way of teaching

  • @ketkidavda8588
    @ketkidavda8588 7 років тому +1

    this is awesome !!! youre a very good teacher :) thanks

  • @philtrem
    @philtrem 8 років тому +7

    These videos are fantastic, thanks a bunch!

    • @SonuSonu-tk5pk
      @SonuSonu-tk5pk 7 років тому

      why dont u go to ur country and study

    • @philtrem
      @philtrem 7 років тому +1

      o.Ô

    • @saurabhshah8802
      @saurabhshah8802 6 років тому +2

      Haha. What's wrong with you man? Its UA-cam. Its free and available to all.

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

    Its 2021 but still the best playlist on Tree DS on youtube

  • @Anoopegi
    @Anoopegi 9 років тому +1

    i love ur tutorial and i think they are best

  • @sindhu1345
    @sindhu1345 7 років тому

    amazing job, this is really helpful, thank you ☺😊

  • @AbhayKulshrestha
    @AbhayKulshrestha 9 років тому

    Very nicely done, thanks for sharing this one for us :)

  • @ZYKLONEITSolutions
    @ZYKLONEITSolutions 9 років тому +1

    Good Work !! Thank You !

  • @TheFlyguy31
    @TheFlyguy31 7 років тому

    Brilliant explanation of the Binary Tree

  • @ImranAliyev
    @ImranAliyev 6 років тому

    Excellent explanation!!!

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

    Incredibly helpful, thank you.

  • @afterworkguinness2452
    @afterworkguinness2452 8 років тому +1

    Excellent tutorial!

  • @gabrielpereiramendes3463
    @gabrielpereiramendes3463 5 років тому

    Great lesson. Very good!

  • @jasonavina8274
    @jasonavina8274 4 роки тому

    that advertisement for charity : water was the best ad i've ever seen. it feel like a changed person and im not even kidding.

  • @sagarshah275
    @sagarshah275 9 років тому

    Your videos are excellent...thanks a lot.

  • @shriyanshgupta8738
    @shriyanshgupta8738 8 років тому

    thanks for teaching in a simple language...

  • @usama57926
    @usama57926 5 років тому

    bro your explanation is amazing

  • @TheOverAndAround
    @TheOverAndAround 10 років тому +74

    at 13:04 I am confused how you say the height of left subtree is 1? I thought it was 2. Say node x is the one in red. I watched the previous vid and it says, the height of x is the number of edges in the longest path of x to a leaf. I counted 2?
    I look at it this way to make it easier.
    if left subtree has no edge - height = 0
    if right subtreee has no edge - height = 0
    if left or right subtree has an edge, add up all the edges leading to the deepest leaf node then use your formula diff = | leftsubtree_height - rightsubtree_height |

    • @mycodeschool
      @mycodeschool  10 років тому +82

      Matt Stewart - We are saying height of left and right subtrees. Height is defined as number of edges in some longest path from root to a leaf. For the sub-trees, the root node is not the node marked in red. For left subtree, root node is the left child and for right sub-tree root node is the right child. We need to calculate from root of the respective subtrees. Let me know if this is still not clear to you.
      Actually, you can calculate the diff, by saying 0 height if there is no child. Actual diff wont change. Lot of people do that. That's ok.. But when we say subtree, we cannot count the node (marked in red here) itself.

    • @TheOverAndAround
      @TheOverAndAround 10 років тому +10

      mycodeschool thanks so much, that makes sense, I didn't understand where the subtree started.Learning alot from your clear vids.

    • @simonetruglia
      @simonetruglia 10 років тому +9

      Matt Stewart
      Thanks for the question :)

    • @GauravTayal26
      @GauravTayal26 6 років тому +5

      Still not clear. Height of left subtree is 2 and not 1 since there are 2 edges from root of left sub-tree to the leaf while chosing longest path. Please clarify

    • @prashanttrar9599
      @prashanttrar9599 6 років тому +5

      Height of the left subtree means counting no. of edges starting from the left node and not from the base root itself, maximum no. of edges from left node to the leaf node is 1 hence, height of left subtree is 1.
      Consider it as a new temporary tree of which base root is the left node and just calculate height of it.

  • @ChildofDestiny22
    @ChildofDestiny22 7 років тому +1

    Would you do AVL, RBT, and 2-3 tree? Your tutorials are awesome!

  • @LAnonHubbard
    @LAnonHubbard 8 років тому

    This is very clear, thank you.

  • @TheGrimReaper0101
    @TheGrimReaper0101 10 років тому

    went through all videos of this play list and hats off guyz .. awesome work..
    eagerly waiting for more videos ..

    • @mycodeschool
      @mycodeschool  10 років тому +1

      Thanks Nitin Kapoor , We will be adding at least 2 videos in this series every week.

    • @mycodeschool
      @mycodeschool  10 років тому

      Nitin, Here is the next video Data structures: Binary Search Tree

    • @TheGrimReaper0101
      @TheGrimReaper0101 10 років тому

      thanks mycodeschool . awesome one again .

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

      ​@@mycodeschool its been 8 years sir, please complete the play list :(((

  • @dilrubakose
    @dilrubakose 7 років тому

    You are such an amazing person
    thanks a lot :)

  • @AkifMasnoon
    @AkifMasnoon 4 роки тому

    amazing content, really loved it :)

  • @PrashantKumar-qk3ew
    @PrashantKumar-qk3ew 8 років тому +5

    I want to provide a suggestion that when you write at down of the board it gets hidden by the words displaying above it.
    Mind it please, it will further enhance your work and thanx for providing the best.😊

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

    for node2 at 12:51 , you mentioned diff = |1-(-1) |
    But Shouldn't it be |2-0| ? Left subtree has height 2 and right as 0... 0 because we still have node 2 and it's not empty node. The difference is 2 anyway.

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

    Wonderful content, thank you very much.

  • @dipaktandel629
    @dipaktandel629 8 років тому

    Great work by u people....!!!!

  • @grizzlybear5701
    @grizzlybear5701 9 років тому +1

    Thank you very much.

  • @rhinethetauren
    @rhinethetauren 3 роки тому +1

    Great lesson. The log stuff threw me off, but I just need to review all that anyway

  • @buzzfeedRED
    @buzzfeedRED 5 років тому

    @mycodeschool Awesome work

  • @surekasunder5923
    @surekasunder5923 4 роки тому +1

    This is a great video. Just had one doubt, i understood we consider height of node as 0 if there are no child nodes and height of tree as -1 if there is no root. However, around 13th minute we considered tree with no child nodes with height -1(instead of 0), also made height of left sub-tree as 1(instead of 2).

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

      yeah, I got confused there too. at 13:11 it should be |2-0| = 2 not |1-(-1)| = 2 by his definition. Am I right?

  • @sweetgalleryloveperez910
    @sweetgalleryloveperez910 8 років тому

    Thank you for this video coz I learn more:)

  • @mortysanchez361
    @mortysanchez361 6 років тому

    thanks for the quality videos.

  • @premalathak6748
    @premalathak6748 9 років тому +6

    please teach redblack tree and splay trees.

  • @harin.g6806
    @harin.g6806 4 роки тому +1

    perfect . Thank you very much.

  • @matttukacs
    @matttukacs 5 років тому

    Based on this it would be safe to assume that using timestamp based primary keys is not a good idea in mysql? It uses b-trees for storing indexes. With id based indices you are essentially constantly building a linked list that mysql has to rebalance in the background. On a very hot table this would result in a lot of extra work necessary to keep read speed reasonable.

  • @saiavinashduddupudi8975
    @saiavinashduddupudi8975 8 років тому +5

    @mycodeschool
    A Small Correction:-
    Maximum no of nodes in a complete binary tree with height h is 2^(no. of levels+1) - 1.
    In the video it is written as 2^(no of levels) - 1.

    • @MuhammadRizkyEkaArlin
      @MuhammadRizkyEkaArlin 8 років тому +1

      +saiavinash duddupudi i think you are mistaken. No. of levels is equal to height + 1.

  • @tejaswininandan7025
    @tejaswininandan7025 5 років тому

    Ur videos r awesome.......... But one simple request........can u plz put that subtitles little down coz we can't see what is written on bottom of the board

  • @minhnguyennhat5112
    @minhnguyennhat5112 6 років тому +2

    Thank you very much for your work. This channel is a fucking gold mine!!!

  • @MVK-eo7gg
    @MVK-eo7gg 4 роки тому +4

    @13:08 How is the height of left sub tree -1? I think it should be 2, right?

  • @mahmoudabdulhady8516
    @mahmoudabdulhady8516 5 років тому

    your are very clever and accurate person

  • @alijafari9576
    @alijafari9576 10 років тому +5

    Even if the tree is not complete you are still able to use an array. You can use -1 or any invalid number for the children that are missing!

  • @jeffberhow
    @jeffberhow 10 років тому +1

    Very clear and concise explanation.

    • @jytreus
      @jytreus 10 років тому

      I just wrote this yesterday. weird
      public class tree {
      private node root;
      public tree(){
      setRoot(null);
      }
      public node getRoot() {
      return root;
      }
      public void setRoot(node root) {
      this.root = root;
      }
      public void inOrderTraverse(node x){
      //System.out.println("boo");
      //System.out.println("root value" +x.getValue());
      if(x == null){
      return;
      }
      inOrderTraverse(x.getLeftChild());
      //System.out.println("hi");
      System.out.println(x.getValue());
      inOrderTraverse(x.getRtChild());
      }
      public void addToTree(int x){
      node n = new node(x);
      if(root == null) root = n;
      else add(root, n);
      }
      public void add(node p, node target){
      //System.out.println("hi");
      if(target.getValue()< p.getValue()){
      if(p.getLeftChild() == null)
      p.setLeftChild(target);
      else
      add(p.getLeftChild(), target);
      }
      else{
      if(p.getRtChild() == null)
      p.setRtChild(target);
      else
      add(p.getRtChild(), target);
      }
      }
      }

    • @jeffberhow
      @jeffberhow 10 років тому

      I was having trouble understanding graphs, and found it was because I didn't understand trees well enough. That's some nice code there. Capitalize your classes, ya dingus!

    • @Buff1nt0n
      @Buff1nt0n 10 років тому

      Are you doing Direct Marketing Strategy diagrams again Jeff?

    • @jeffberhow
      @jeffberhow 10 років тому

      No, but it sure does look similar. This is a portion of a Computer Science class I had last semester and I was brushing up.

    • @Buff1nt0n
      @Buff1nt0n 10 років тому

      The mystery of the unknown intrigues you doesn't it? Me too!

  • @tonmoyacharjee2491
    @tonmoyacharjee2491 9 років тому

    very helpful, thanks...

  • @sunitsingh5429
    @sunitsingh5429 9 років тому +10

    i have a doubt..@13:06 why is the height of the left subtree 1 and not 2? i mean given that height of a node is the maximum path up from a leaf,shouldnt it be 2?

    • @theFifthMountain123
      @theFifthMountain123 7 років тому +4

      Note the word "subtree". Subtree is the blob after edge from the red node. The blob has 3 nodes total; height of the blob is 1. Thus, height of left subtree is 1.

    • @abhinavmishra6648
      @abhinavmishra6648 7 років тому

      theFifthMountain123 Thanks man!

    • @theFifthMountain123
      @theFifthMountain123 7 років тому +1

      Abhinav Mishra I'm a woman. Not your fault though, typical programmer is a nerdy guy which I'm not.

    • @ZeeshanAli-ck3ue
      @ZeeshanAli-ck3ue 5 років тому +2

      @@theFifthMountain123 if this is the case that you mentioned above then how did you find difference one at 12:49.AS your both lest and right sub-tree height is one.

  • @ishratrhidita9393
    @ishratrhidita9393 5 років тому +5

    How did you get 1 left child in 13:04 seconds? There are two edges from the left subtree to the leaf.

    • @eagerassaultixopi4558
      @eagerassaultixopi4558 5 років тому

      left subtree is the node left to the node marked in red which has height of 1 where as right subtree is the tree on the right of red marked node which has height of -1 coz it is empty

  • @kaushikdr
    @kaushikdr 4 роки тому

    The height is the maximum depth of a leaf node in the graph! Height and depth can be the same when a node has as many ancestors as descendants :)

  • @smitatripathi3085
    @smitatripathi3085 5 років тому

    Thnqq u sir ,this video is very usefullll,,thnqqqq uuuu soooooo muchhhhhhhhhhh☺☺

  • @satyajitchandankar418
    @satyajitchandankar418 4 роки тому

    nice! really helped!

  • @krishnakandula6587
    @krishnakandula6587 4 роки тому

    Great tut

  • @neelpatel122
    @neelpatel122 5 років тому

    Great stuff