Balanced binary search tree rotations
HTML-код
- Опубликовано: 30 июл 2024
- Learn about balanced binary search tree rotations
Practicing for interviews? I have used, and recommend `Cracking the Coding Interview` which got me a job at Google. Link on Amazon: amzn.to/3cvMof5
A lot of the content on this channel is inspired by the book `Competitive Programming` by Steven Halim which I frequently use as a resource and reference. Link on Amazon: amzn.to/3wC2nix
===========================
Related videos:
AVL tree intro: • Balanced binary search...
AVL tree insertions: • AVL tree insertion
AVL tree removals: • AVL tree removals
AVL tree code: • AVL tree source code
AVL tree source code:
github.com/williamfiset/algor...
Why are free videos on the internet better than my college professors. Have a midterm on BST stuff tomorrow, this is a major help.
hello connor6woop
Because teaching is not the main profession of your professor. Their real job is to do research but they teach on the side. You can expect them to understand the material very well; however, you can't expect them to know how to convey that information very well even though you are probable paying up the ### to take their course.
Extremely concise and clear! I was just asked how a self-balancing tree works and.. while I know how binary trees are built and function, I never learned about rotation and balancing.
Great video man, exactly what I needed! Helped me a ton :)
That's by far superior to what my prof forced out of himself. Thanks!
A balanced binary tree, also referred to as a height-balanced binary tree, is defined as a binary tree in which the height of the left and right subtree of any node differ by no more than 1.
I have a question: How to insert a new node to an existing balanced binary search tree (not an AVL tree)? Do I insert the new node normally like how I would with a binary search tree and then apply rotations? Or do I insert it into an array first, sort the array and then rebuild the balanced binary search tree?
This is a top 5 educational video of all time
Absolutely incredible. Thank you very much for your videos!
Dude... Ur Amazing visuals making damn easy... How come I found this late... I Bookedmarked urs... Awesome explanations..
Thanks man really helped out.
Thanks a lot from Brazil!
a very good explanation, thank you 👏
Thank you for this very helpful video!
7:00 I think the code would be simpler by having methods that handle the double pointer update, i.e. methods `setLeft Child` and `setRightChild` which update the corresponding left/right pointer as well as the parent pointer, if any.
Thanks for making man! Super helpful.
Great video!
3:13 I think it would have been best to label the nodes such that the inorder traversal is
A, B, C, D, E
To the point and clear explanation :) please note, the AVL tree intro: might not be the correct link. Thanks
Considering the alphabetical order and the invariant as n.left < n and n < n.right; the BST shown in the videos does not satisfy the invariant condition.
In the left tree we have N.left = B, n = A, and n.right = C. Now, B < A < C is not true. in the right tree: D < B < A < C is not true.
exactly i don't understand this. did you figure out what he is trying to say?
damn.. that's beautiful!!!!!!!!! Thank you so much!!!
top 20 university and this video explained something i didnt understand for an hour in lecture in 8 mins
Amazing video man love it
What is the difference between remove and delete?
3:31 defines BST as n.left < n and n > n.right. Now go to example at 4:25. Let's assume A = 4, B = 3, D = 1, and E =2. If when we rotate we make E the left child of A we follow the definition as to A, but we now fail the definition as to B because E < B even though E is in the right subtree of B. That would mean that if we searched the tree for the value 2 we would start at the root B with value 3 and go to the left subtree which would not lead us to E thus we would lose our O(log n). I am struggling to reconcile this.
I see now that if B = 3 then E has to be >= 3 so it could not = 2.
Thanks
3:31 does E have to necessarily be less than A? What if it is more?
Two trees at 3:10 are a bit confusing! It would better if numbers were used instead of letters.
Preparing to my amazon interview with your videos. Thanks!
Thanks for the great explanations squeaky-voiced teen from Simpsons.
Your explanations actually help a great deal and are more entertaining than my text books:)
great explanation
This is pure torture... :P Thanks though.. Got an exam tomorrow and this helped..
Can some one tell me how is D < B? and how is A > C?
This is AMAZIN !
Way better than the crap served in MIT Open Courseware
What is a "logarithmic height"?
What is a "linear height?"
Would it not be better to say a height based on linear proportions?
I do not like meaningless language which this seems to be an example of. Pease feel free to explain :-). Maybe I'm not "getting it"
Computer Scientists: "Let me introduce you to the secret high-art of informatics, young Padawan!"
me: "Haha jQuery go brrrrrrrrt!"
u saved me
the goat
My collage professor(he actually didn't deserve to br called a professor) did this topic it took him a whole hour long and in the what we got was lots of confusion
Blanced Binary Search trees are cool
Your website has an error !!! 503 Error .
The DSW algorithm works well for balancing like this.
I still don't understand lol
u seem too surprised by elementary things. It's a bit annoying and distracting.
Anyways, ok video. Helped me learn so thanks.
kkkkkkkkaren