Tree Traversals-Inorder traversal

Поделиться
HTML-код
  • Опубликовано: 11 ноя 2024

Комментарии • 56

  • @ryandavis7506
    @ryandavis7506 8 лет назад +9

    Not even finished with the video, but I wanted to pause it, so that I would not forget to thank you. Not sure why this wasn't clicking before. I think because my book just shows the overloaded recursive functions with structure-pointer notation, so it's difficult to see the forest through the trees. Thank you for this AWESOME example. I understand it now, and you are good dude for it. Thanks again. I will subscribe.

    • @AppleJuiceTeaching
      @AppleJuiceTeaching  8 лет назад +2

      +Ryan Davis Thanks man! Let me know if you need any more help

    • @tahirmahmood4734
      @tahirmahmood4734 8 лет назад

      Hi, I have watched your videos, they are amazing, I want your help on urgent basis, I want you to make a video to implement adding a Number to a Splay tree, Deleting a number from Splay tree, and searching a number in a splay tree. You have explained really well, but I want you to practically show how its done in coding. :) I'll be waiting for your response.

  • @swanandm.9502
    @swanandm.9502 9 лет назад

    Thank you. "can i go left", "can i go root"..... these simple ways helped me out.

  • @gregtaylor2498
    @gregtaylor2498 10 лет назад +2

    thanks for this, it's in our exam. Id like to make a suggestion to improve this method. Instead of remembering what you've visited to determine the next step (e.g. L --> N --> R) it's a good idea to keep track by writing the element each visit until you get the full sequence of LNR instead of remembering in your head it can be visual and standout more to know what to do next. Great video none the less.

  • @mrkaa001
    @mrkaa001 11 лет назад

    I followed your tree using paper and pen, replacing 12 with 26 and it worked out well! thanx for explaining :)

  • @luckyluke8614
    @luckyluke8614 11 лет назад

    Hi! There's another straightforward (and non-thinking :D ) trick for inorder. Put a pencil vertically on the left side of the tree and then move it to the right (like erasing the tree with a sponge). Write out the numbers in order the pencil has touched them. However, when drawing a tree, you must be careful that it's visually well drawn. For instance, you have to watch out that, let's say, 50 is not on the left side of 12. You have to draw it nicely like this one, don't draw it too tight.

  • @jenkov2155
    @jenkov2155 8 лет назад

    After I watched your video I understood how easy it is. Thank you very much, very good video.

  • @AppleJuiceTeaching
    @AppleJuiceTeaching  11 лет назад

    now check the element 30 and thats the next element, you cant go anywhere so pop the stack and go back to 25 ( you only pop after you have checked all the left element and right in that order) that is how it is thought of a stack. I hope you get it now

  • @zahragolpayegani4058
    @zahragolpayegani4058 8 лет назад

    I think what you have is correct! You Do have a binary tree with value of 12 in that node, however it is NOT a BINARY SEARCH TREE! Thanks :)

  • @crazypigs100
    @crazypigs100 8 лет назад +1

    a bit unorganised but hey you got the point across very well. LNR. Now i understand what that means! Thanks :-)

  • @AppleJuiceTeaching
    @AppleJuiceTeaching  11 лет назад

    When you go down the tree from 50 to 25 to 1, think of that as a stack and when you cant go left anymore you write down the top of the stack and then pop it off (because you cant go left or right), then your back at the last element (25), then you cant go left so you take the element (25). Then you check left, the element (which you already picked), but you can go right so 30 or whatever (12 is wrong by the rules of a binary search tree,sorry). You go there check left, nothing

  • @pripri8814
    @pripri8814 11 лет назад

    how a stack is filled up and popped during the recursive definition of inorder traversal? Can you please tell

  • @xoppa09
    @xoppa09 10 лет назад +1

    why does 12 have to be greater than 25? sorry im new to this, i am just learning

  • @abdi5501boone
    @abdi5501boone 11 лет назад

    You sir are a genius.

  • @TheOverAndAround
    @TheOverAndAround 10 лет назад

    thanks so much for these vids, very clear to understand.

  • @victoraul1
    @victoraul1 8 лет назад

    Thanks, you saved me time!

  • @sajiththilakan
    @sajiththilakan 10 лет назад

    Ty very much . And i laugh twice in the middle of the tutorial, at the arrow not erasing and the number are not in order thingy :D

  • @berkaybingol6792
    @berkaybingol6792 8 лет назад +1

    Thank you ! I got it,This actually helped me alot,

  • @sreelekshmyrengith8376
    @sreelekshmyrengith8376 9 лет назад

    Thanks a ton!!!Helped a lot!

  • @andrewdsotomayor
    @andrewdsotomayor 9 лет назад +2

    Thanks you sir, for you have enlightened me!

  • @MarcoMeerman
    @MarcoMeerman 9 лет назад

    Geest explanation!

  • @yunuskasimk
    @yunuskasimk 8 лет назад

    Thanks! It really helped me sir!

  • @granceroblast
    @granceroblast 11 лет назад +4

    there is a mistake in your tree. Check 12 and 25.

    • @AppleJuiceTeaching
      @AppleJuiceTeaching  11 лет назад +2

      your right 12 is incorrectly position in the binary tree imagine it being a 37, the process is still the same for how you visit the nodes however.

    • @sagejr9295
      @sagejr9295 10 лет назад

      Apple Juice Teaching actually its correct if it is simply a binary tree, if it were a binary search tree it would be wrong.

    • @GauravSehrawat8888
      @GauravSehrawat8888 10 лет назад

      Apple Juice Teaching I agree with sagejr If it is binary tree it is correct but if it is binary search tree then it is incorrect by definition.

    • @Zenitram133
      @Zenitram133 10 лет назад

      sagejr It is a binary search tree since you are traversing the data... Please be serious.

  • @simonolsen8022
    @simonolsen8022 9 лет назад

    Nice video man! Thanks!

  • @loadge
    @loadge 11 лет назад

    Thank you! This was useful.

  • @Kopellouroui
    @Kopellouroui 8 лет назад

    Best explanation! Thnx m8!

  • @husseinmrad3583
    @husseinmrad3583 7 лет назад

    Amazing video !! thank you

  • @ulianazlotnik3093
    @ulianazlotnik3093 7 лет назад

    thank you!

  • @mangeshbadgujar7678
    @mangeshbadgujar7678 7 лет назад

    thank you sir.

  • @roshenw
    @roshenw 10 лет назад

    Thanks very much!!

  • @hoavu7764
    @hoavu7764 8 лет назад

    Is this a binary search tree, how can 12 be the right child of 25 ?

    • @AppleJuiceTeaching
      @AppleJuiceTeaching  8 лет назад

      +Hoa Vu 25 does violate the binary search tree rules. I made the tree wrong, 12 should be a number greater than 25 but less than 50.

  • @luongphung2779
    @luongphung2779 11 лет назад

    good tut

  • @Skazyyyy
    @Skazyyyy 11 лет назад

    Thank you so much

  • @abdullahsultan85
    @abdullahsultan85 11 лет назад

    thank you !! :)

  • @richardlionnelcruz
    @richardlionnelcruz 10 лет назад

    lol what is the first thing he says? What's ____.

  • @GreatWhtieNorth
    @GreatWhtieNorth 9 лет назад

    whats gucci everybody

  • @liquidoshin
    @liquidoshin 11 лет назад

    just to let you know, probably already know this, but your tree is not sorted. the 12 is in the wrong place

  • @haroon78644
    @haroon78644 9 лет назад

    ummmmmmmmmmmmmmmmmmmmhh
    thats good

  • @joaom8289
    @joaom8289 8 лет назад

    your tree is wrong, you cant have 12 as child of 25

    • @ksatia
      @ksatia 8 лет назад +1

      applies to a BST but not trees in general. You can perform pre, in & post-order traversals on non binary search trees, so you can actually have 12 as a child of 25.

    • @ksatia
      @ksatia 8 лет назад

      Also I think you meant that you can't have 12 as a RIGHT CHILD of 25. In a BST, you can still have it as a child of 25, but only as a LEFT child node.

    • @joaom8289
      @joaom8289 8 лет назад

      Hello. Yes I meant BST. It would be better to make that distinguishing clearer. The way it is presented its counter pedagogic in my opinion. Bit thank you.

    • @ksatia
      @ksatia 8 лет назад

      totally agree. I actually think that somewhere in the comments the uploader mentioned that he meant to make it a BST :)

    • @joaom8289
      @joaom8289 8 лет назад

      Thank you Karan, kind regards