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.
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.
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.
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.
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
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
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.
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.
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.
+Ryan Davis Thanks man! Let me know if you need any more help
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.
Thank you. "can i go left", "can i go root"..... these simple ways helped me out.
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.
I followed your tree using paper and pen, replacing 12 with 26 and it worked out well! thanx for explaining :)
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.
After I watched your video I understood how easy it is. Thank you very much, very good video.
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
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 :)
a bit unorganised but hey you got the point across very well. LNR. Now i understand what that means! Thanks :-)
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
how a stack is filled up and popped during the recursive definition of inorder traversal? Can you please tell
why does 12 have to be greater than 25? sorry im new to this, i am just learning
You sir are a genius.
thanks so much for these vids, very clear to understand.
Thanks, you saved me time!
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
Thank you ! I got it,This actually helped me alot,
Thanks a ton!!!Helped a lot!
Thanks you sir, for you have enlightened me!
+Andrew Sotomayor Thanks man!
Geest explanation!
Thanks! It really helped me sir!
there is a mistake in your tree. Check 12 and 25.
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.
Apple Juice Teaching actually its correct if it is simply a binary tree, if it were a binary search tree it would be wrong.
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.
sagejr It is a binary search tree since you are traversing the data... Please be serious.
Nice video man! Thanks!
Thank you! This was useful.
Best explanation! Thnx m8!
Amazing video !! thank you
thank you!
thank you sir.
Thanks very much!!
Is this a binary search tree, how can 12 be the right child of 25 ?
+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.
good tut
Thank you so much
thank you !! :)
lol what is the first thing he says? What's ____.
Gucci!
Apple Juice Teaching what does that mean?
+richardlionnelcruz a luxury brand :D
whats gucci everybody
just to let you know, probably already know this, but your tree is not sorted. the 12 is in the wrong place
ummmmmmmmmmmmmmmmmmmmhh
thats good
your tree is wrong, you cant have 12 as child of 25
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.
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.
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.
totally agree. I actually think that somewhere in the comments the uploader mentioned that he meant to make it a BST :)
Thank you Karan, kind regards