why did 8 'split' the 9 node? every other number went down the tree to the last entry and then to the left or right of it but 8 went to 9, skipped 14 and went to the left of 9. Why is that?
As far as I understand, the value to be added is compared with each node, starting from the root, and it must reach a leaf node (node without any child nodes) that it'll get added to. The traversal of the whole tree seems to work like this: Compare node with first node (root) If smaller, then "move" in the left. Otherwise, move to the right. Repeat for each node until a leaf node is reached.
About 7 - your argument is that it goes right, because it's NOT LESS then 7, i can got with the same argument and say it can't got left because it's NOT GREATER then 7. It should just remain the way it was, without adding extra 7 into the tree.
Might be out of the scope of the video but what would happen if you search for 7. Would it return the 7 on the first node or the 7 on the last node or both?
its an old video but he's made a mistake with 7. Binary search trees have these properties: 1) you cannot have duplicates 2) Can have at most two children -> Consequently the placement of '7' is wrong. It should have been ignored when placing the second time because its already accounted for
Is this in order or pre order or post order. I am so confused by the 3. I can print out what happens but not draw those tree up from initial array. Anybody that can help me please do, I have a test on monday ;(
These is just making a BST from a series of numbers. Preorder and inorder and postorder is for when you have the tree, and you want to navigate it. So this video is about creating a binary search tree, which you can navigate later with those three methods.
Very well explained. I really had hard time understanding BST before this video!
Hello to students from The Odin Project
Hi there, a student from Odin
wow, not many students left huh
heyyy
Hey ;)
Hello fellow odin
I always thought binary search trees had to be balanced and that was giving me a hard time. I know now that having an ugly tree is perfectly fine
same!
you still need a balanced tree if you want to run faster search, insert, etc operations.
#1 explanation about BST in U-tube. 100% 👍👍👍
Thanks!
Awsome sir i got full marks in my examination at this question.
I'm glad that you found it helpful!
Thank you so much for helping me understand the concept !!
Glad to hear that!
Thanks man, you saved me! :D
why did 8 'split' the 9 node? every other number went down the tree to the last entry and then to the left or right of it but 8 went to 9, skipped 14 and went to the left of 9. Why is that?
As far as I understand, the value to be added is compared with each node, starting from the root, and it must reach a leaf node (node without any child nodes) that it'll get added to.
The traversal of the whole tree seems to work like this:
Compare node with first node (root)
If smaller, then "move" in the left.
Otherwise, move to the right.
Repeat for each node until a leaf node is reached.
This video saved me . It's really helpful.
I'm glad that you found it helpful!
What if we want to search 7? is the last 7 after 8 will be searched or when it search the first 7 and the search end?
About 7 - your argument is that it goes right, because it's NOT LESS then 7, i can got with the same argument and say it can't got left because it's NOT GREATER then 7.
It should just remain the way it was, without adding extra 7 into the tree.
Actually if a number is equal or greater, it goes right
thank you .
so much "Understanding"
Great explanation !!
this is why binary search is only effectively working on already sorted arrays
Can you draw BST's in a different order but it still follows the rule of a BST? like can there be 2 versions
Excellent explanations
Glad you think so!
From TheOdinProject .
Might be out of the scope of the video but what would happen if you search for 7. Would it return the 7 on the first node or the 7 on the last node or both?
its an old video but he's made a mistake with 7. Binary search trees have these properties:
1) you cannot have duplicates
2) Can have at most two children
-> Consequently the placement of '7' is wrong. It should have been ignored when placing the second time because its already accounted for
Superb sir..❤️
Thanks a lot 😊
thanks man you saved the day
I'm glad that you found it helpful!
You’re directly going to heaven😌💫
👐
what is the order of building BST from an array?or for example,building BST from 3 sorted arrays?
my understanding is that it does each array in an arbitrary fashion, so starts at one, finishes, moves on to next
Very helpful!
Glad you think so!
Well explained
Thanks!
Is this in order or pre order or post order. I am so confused by the 3. I can print out what happens but not draw those tree up from initial array. Anybody that can help me please do, I have a test on monday ;(
These is just making a BST from a series of numbers. Preorder and inorder and postorder is for when you have the tree, and you want to navigate it. So this video is about creating a binary search tree, which you can navigate later with those three methods.
nice video
What is the software you are using?
Hare Krishna hare Krishna Krishna Krishna hare hare
Hare ram hare ram ram ram hare hare
Thanks man saved!
I'm glad that you found it helpful!
can we put 7 in left side of 7
No, I think because 7 isn't less than 7
Thank u sir..
are duplicates allowed in a BST? (7)
+Aranta Chatterjee Nope!
that's wat i was wondering abt
why repeat 7??? what if you are asked to delete 7 from this binary tree you have formed
Thank you so much..this helped!
Thank you very much
Thank you! :)
You're welcome!
Thanks
I need graphics project code on this...
Thanks !
Thank you
You're welcome!
thank u man
predkozka ready ako nikdy predtym
moja obriezka je ready
thx help alots
I'm glad you found it helpful!
brano sup sem sup tam caka na komentare
ready sme
bzzzt
helal
you are beautiful
this is terrible and may as well be a linked list