AVL Trees & Rotations (Self-Balancing Binary Search Trees)

  Рет қаралды 338,517

Back To Back SWE

Back To Back SWE

Күн бұрын

Пікірлер: 359
@TheAntloo
@TheAntloo 4 жыл бұрын
Hey man just realized I never actually thanked you, I passed my interview and your videos were so much help!!! You are awesome!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great - flourish in life friend
@DavidVCastro
@DavidVCastro Жыл бұрын
@TheAntloo, how many times have you used an AVL Tree in your job of two years? 🙂
@yonathanmichael1910
@yonathanmichael1910 3 жыл бұрын
This kid's older brother is one of my little homies from college. Now i'm reviewing algorithms and the little little homie is teaching me. Both impressive young men who are making their families proud.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
haha hey
@WyMustIGo
@WyMustIGo 3 жыл бұрын
Looks like this homie stopped the videos because there is no money in teaching for free. That means he gained wisdom and is using his knowledge to make a profit instead... Homie is getting wise.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Check out the free DSA Mini-Course 👉backtobackswe.com/five-day Table of Contents: Introduction 0:00 - 2:07 Tree Height 2:07 - 3:51 Node Balance 3:51 - 4:21 Balance Calculation Practice 4:21 - 7:32 Breaking The AVL Property 7:32 - 8:32 Rotations 8:32 - 12:52 Right Rotation 12:52 - 15:58 Left-Right Rotation 15:58 - 18:12 Left Rotation 18:12 - 18:50 Right-Left Rotation 18:50 - 19:44 Support Us At backtobackswe.com 19:44 - 20:37 Errors: 0:19 - 1:41 The is not a BST, this is fixed at 1:41. 11:08 NIT: The purple triangle is > y (strictly greater) and > x I hope this helps someone. If there are any mistakes let me know and I'll update the "Errors" section.
@dramallama111
@dramallama111 2 ай бұрын
As always, why is that some guy on youtube can explain these concepts so much better, and in a shorter amount of time than most college professors? It boggles the mind.
@amirPenton
@amirPenton 4 жыл бұрын
Started BSTs in class and we have to implement our own AVL tree. The textbook didn't cover left-right or right-left rotations nearly as well as you did. Thanks so much for this video, I will be citing this in my project.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@arjunkashyap8896
@arjunkashyap8896 4 жыл бұрын
This is the clearest explanation I have seen on Balanced Trees so far. I was trying to learn this topic back in march and I could not find a good resource to understand and I dropped this topic. Now today I picked it back up and I found your video. Thank you so much !! ---> Subscribed
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure!!
@Happy.Vagabond
@Happy.Vagabond 3 жыл бұрын
Hey you probably get this a lot, but you helped me so much to prepare for my interview. I have been non-stop preparing for my coding interview at my dream company at Microsoft. I've been prepping 8-10 hours a day every single day on LeetCode and watching your videos. You have helped me so much in learning the fundamentals and learning how to approach different coding problems. I'm glad to say that I did get an offer from Microsoft yesterday! Again, I thank you so much. Your videos were the main reason I was able to get this offer. You have truly changed my life.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great to hear. grow strong.
@S189-g7s
@S189-g7s Жыл бұрын
hey! im new in coding, can you explain me how did you prepare and any advices for beginers like me? i would appreciate a lot!
@MaxPicAxe
@MaxPicAxe 2 жыл бұрын
OMG the way you explained it around 12:30 makes so much sense. I don't need to memorize anything, I just need to think through whether each triangle is less than or greater than x, and the same thing for y, and then it's so easy to perform the rotation. Thank you!
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thank You, Glad you liked it. Do check out backtobackswe.com/platform/content and please recommend us to your family and friends :)
@yoyocontact5181
@yoyocontact5181 4 жыл бұрын
I lost my job due to the covid-19, now learning and prepping for Tech interviews. Life is tough these days. Also, please please upload more videos on Linkedlists . ( all if possible - from start to end )
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
message us we can work something out - backtobackswe.com/contact
@yoyocontact5181
@yoyocontact5181 4 жыл бұрын
@@BackToBackSWE Done. Please check.
@BoonkiCoC14
@BoonkiCoC14 Жыл бұрын
Before i watch the video again gotta let you know, this was hands down the best illustration ideo for AVL trees. The illustrations are easy to follow. Cheers.
@יעלליפשיץ-ס6ש
@יעלליפשיץ-ס6ש 4 жыл бұрын
Thank you for this video! finally I understood AVL trees!! I will keep commenting each video I see that helped me to keep supporting you! you are great!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great
@weallgotwoodandnails
@weallgotwoodandnails 4 жыл бұрын
Clear, concise, and invaluable. Thank you for uploading this.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks - sure
@rustyshackleford2605
@rustyshackleford2605 2 жыл бұрын
The clarity of your explanation is astounding. Thanks a bunch!
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Haha! thanks. Try out the free mini course on our website - backtobackswe.com/
@abhinavsingh4221
@abhinavsingh4221 4 жыл бұрын
Just few moments ago I was really missing you and your content and now your video is here!! Welcome back buddy :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey.
@frankhu5418
@frankhu5418 4 жыл бұрын
I got a Microsoft SWE II position from your awesome videos! Thank you so much for your videos, I really don't think I would have been able to do it without you.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great to hear. mission accomplished. May we get a testiomonial from you? You can message Ben at www.linkedin.com/in/bephrem and we can go from there. If not all is well, congratulations.
@frankhu5418
@frankhu5418 4 жыл бұрын
@@BackToBackSWE I sent an invite from my LinkedIn with a msg. Not sure how you want to do the testimonial pending your response.
@doublaitmaxim7540
@doublaitmaxim7540 4 жыл бұрын
I have a test tomorrow on binary trees and this video really helped me out so thank you so much! !!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great
@sickmilk
@sickmilk 3 жыл бұрын
First time here. Was searching info about AVL, had problems with understandings it. And occasionally find this channel. Man it is incredible. Totally awesome. It's so clear for me after your explanation. I've also checked the list of your videos. And I am joining this great channel and will advise it to my friends! Thanks for the content!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thanks and great to hear
@shilpag08
@shilpag08 4 жыл бұрын
I actually like you being on the frame. Helps to focus more and real lecture feeling
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@hyeonsooleesandoz998
@hyeonsooleesandoz998 Жыл бұрын
Perfect explanation of AVL rotation !! I've watched the videos about this subjet in French, Korean and English. And only your video makes me understand CLEARLY and PERFECTLY. Thank you so much.
@BackToBackSWE
@BackToBackSWE Жыл бұрын
Glad it helped 😄 We also have a Free 5 Day DSA Interview Prep Mini-Course - backtobackswe.com/ 🎉
@jonathantraverso4072
@jonathantraverso4072 Ай бұрын
You have a gift when it comes to explaining things!
@lalitvavdara5841
@lalitvavdara5841 4 жыл бұрын
This Is the crystal clear explaination of AVL trees I have seen on the Internet....!! You are awsome!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure yo
@lalitvavdara5841
@lalitvavdara5841 4 жыл бұрын
@@BackToBackSWE stackoverflow.com/questions/63649722/satisfying-properties-of-nodes-after-rotation-in-avl-trees I have this question after watching your video It would be really helpfull if you can answer it or any one reading this could answer.
@timjoyalle318
@timjoyalle318 2 жыл бұрын
I found your channel smack in the middle of my data structures and algorithms class. We just started covering this. Excellent!
@BackToBackSWE
@BackToBackSWE Жыл бұрын
That is awesome!
@ishaansrivastav5732
@ishaansrivastav5732 4 жыл бұрын
Its hard to find a teacher who explains better than you SWE. Also, +1 on the tries tutorials would love that
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks and ok
@benzeltser9851
@benzeltser9851 4 жыл бұрын
NEVER STOP UPLOADING
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
OK I WON'T
@stevendeng2758
@stevendeng2758 4 жыл бұрын
It's definitely the best course that I've ever seen about AVL tree.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@hascuhas
@hascuhas Жыл бұрын
Thank you, I never understood AVL trees from my university courses. Your explinations made it crystal clear for me.
@mritunjaypathak251
@mritunjaypathak251 3 жыл бұрын
Dude Where are you these days, no video for 8 months........you ok buddy?
@eishkapoor703
@eishkapoor703 3 жыл бұрын
Hey man, don't comment alot but I just wanna thank you for being a big part in me getting an internship. The work you do is invaluable, and I for one really appreciate it. Keep grinding these out, you got a life long sub in me
@nands4410
@nands4410 3 жыл бұрын
Congratulations Where did you get the internship at
@yutaitadori7318
@yutaitadori7318 3 жыл бұрын
Yeah eger to know @Eish
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Congrats mate! Keep hustling
@DanielDiaz-rq3ko
@DanielDiaz-rq3ko 2 жыл бұрын
I know this video came out awhile back but if you see this, thank you so much! I just didn't understand it in class and when my professor explained it again to me. You literally made this such an easy concept to get!! Thank you !!!!
@BackToBackSWE
@BackToBackSWE Жыл бұрын
Glad it helped!
@mayurkoli4145
@mayurkoli4145 4 жыл бұрын
Hey hey!!! My friend is back, Welcome ✌️✌️☺️☺️
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey.
@jenweatherwax7113
@jenweatherwax7113 4 жыл бұрын
Lost me when counting nodes became positive and negative @6:10 ...is it negative when you go right, and positive if left?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Hi, is this referring to balance at a node?
@jenweatherwax7113
@jenweatherwax7113 4 жыл бұрын
Back To Back SWE Yes 😂 that is very confusing for me. All the positive 1 and negative 1 values
@AlWwW1
@AlWwW1 4 жыл бұрын
Hey! I’m also a UMD student, great video! I was wondering what camera do you use to record and what mic do you use? Thank you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey. Camera: www.amazon.com/Canon-Mirrorless-Camera-EF-M15-45mm-Video/dp/B079Y45KTJ Mic + Mount: www.amazon.com/gp/product/B07K1XSDZP/ref=ppx_yo_dt_b_asin_title_o04_s00 iPad: www.amazon.com/gp/product/B07XL7G4H6/ref=ppx_yo_dt_b_asin_title_o02_s00 Pencil: www.amazon.com/gp/product/B082V9VFFZ/ref=ppx_yo_dt_b_asin_title_o02_s01
@BurahaunUddin
@BurahaunUddin Жыл бұрын
Great video. Quick question though: Typically to calculate balance factor should we not do height of right - height of left. This way if its a left heavy tree you can tell because the balance factor will be < -1 and a right heavy tree will have a balance factor > 1?
@svenzanetti5637
@svenzanetti5637 3 жыл бұрын
Very clear explanation! Is the tree at 8:30 actually a BST though? Because 0 is to the right of 2...
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
I think I correct it
@MoscleBrog
@MoscleBrog 8 ай бұрын
my god i understood his explaination and i feel fun doing this work it kinda feel like rubiks cube. this channel is a magic of understanding
@badrivenkatesan6045
@badrivenkatesan6045 4 жыл бұрын
I've never waited eagerly for the next video of any of the youtube channels literally except yours. Every syllable of your explanation makes sense and is very clear. I wanted to request video for few leetcode problems, try to include these in your line-up. Dungeon Game, Path Sum III, Frog Jump. Thanks in advance!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks! but we likely wont be able to do those. We have a lot of organizational things going on that have us busy
@elijahye7049
@elijahye7049 2 жыл бұрын
Around 11:25, when the purple tree has to be greater than y right? Since y < x and purple >= x.
@raywei1701
@raywei1701 9 ай бұрын
OMG SO CLEAR sooooo clear guys watch it , this is the best video for understanding the AVL tree~!
@BackToBackSWE
@BackToBackSWE 9 ай бұрын
Happy Holidays 🎉 No, you are the best Raywei! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@hawadoh
@hawadoh 6 ай бұрын
After spending 12 hours non-stop trying to fix just one bug in my AVL tree (with parent node pointers) I've decided to take a step back and watch this video, and this is so much help! I am going to try again now after eating
@Delinester
@Delinester 10 ай бұрын
This author explained AVL trees better than our professor in 2 lectures. Thank you!
@BackToBackSWE
@BackToBackSWE 9 ай бұрын
Happy Holidays 🎉 Thank you for your kind words, Delinester! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@OktayDerman
@OktayDerman 8 ай бұрын
professors are like not-teaching teachers at schools stay away from them, go after assistants.
@mattrieckenberg
@mattrieckenberg 3 жыл бұрын
Thank you. You explained it much better than my professor
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thanks
@a_k__
@a_k__ Жыл бұрын
Which app on iPad r u using for demonstration? Seems handy
@shilpag08
@shilpag08 3 жыл бұрын
Hey buddy, you are amazing. Surprisingly I could end up with a solution to a Salesforce coding interview. All with the method of thinking and approach that you convey.. I dont think I would ever get the crux with any other site. Thanks a lot . Please keep posting videos , would love to hear you
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Amaze. Keep grinding!
@manhalrahman5785
@manhalrahman5785 4 жыл бұрын
Thanks I used to hate avl trees a lot because of rotations. But this video fixed it
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great.
@thatoneguy9287
@thatoneguy9287 Жыл бұрын
Thank you, it definitely helped alot but still i cant figure how do i determine if i need a left or a right left rotation? Like on what do i have to look to know which to use?
@pokepe12
@pokepe12 2 жыл бұрын
Thanks a lot man, my professor's explanation was needlessly complicated so this helped a lot.
@binupandey6247
@binupandey6247 2 жыл бұрын
Hi 👋
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Haha! why don't you explore our free mini course - backtobackswe.com/
@bradhanks7837
@bradhanks7837 4 жыл бұрын
I'm just commenting to help your videos rank. :) Great stuff and I appreciate all the time you have invested in this channel.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha tru and yeah jeez its been a year, almost 2
@akshayagarwal2714
@akshayagarwal2714 4 жыл бұрын
Benyam, you are PRO man! I am fan of your teaching style! Your videos have helped me a lot in my prep. Now I have come back for yet another interview, going though your videos first for a quick learning. May this channel be in everyone's recommendation! KZbin you better be listening! XD
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks - we are humbled
@marcocaniglia2047
@marcocaniglia2047 4 жыл бұрын
awesome video, my professor should watch these before lecturing lmao. Thank you!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
lol thanks!
@Rishirajsingh2758
@Rishirajsingh2758 4 жыл бұрын
Hey bro , I have loved your teaching methodology , I have started visualising the algorithms , I love you man thank you so much. Could you try to cover up segment trees if possible
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great. and yes.
@eberrodrigues4531
@eberrodrigues4531 4 жыл бұрын
Clear yet thorough. Thank you man!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Sure!
@kevinw6237
@kevinw6237 11 ай бұрын
thank you very much sir. very nice explanation indeed. is there a subsequent video that demonstrate code examples?
@WatchM3Fail
@WatchM3Fail 3 жыл бұрын
This is the simplest vid I’ve seen on this, thanks!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
Glad you liked it!
@JessPen00
@JessPen00 2 жыл бұрын
my professor literally puts me to sleep, thank you so much for this video
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Haha! explore our full DSA based courses with promo code ‘KZbin40’ with a 40% discount - backtobackswe.com/pricing
@srinivasv1488
@srinivasv1488 4 жыл бұрын
Sir, I want to join your course When will course start or can I join whenever I can?. Is there any discount for the course?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
It is just a perpetual service. We do not have any open discounts, but we have an email list we send discounts to sometimes.
@QwertyNPC
@QwertyNPC 4 жыл бұрын
For 15:10 the nodes You drew and erased I think the point is they can't exist, or rather if they existed the tree would be actually balanced. Or am I missing something ?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I'm not sure what I said (rapid replying to comments can't go in and watch and I don't like watching myself)
@mystica7284
@mystica7284 4 жыл бұрын
yo welcome back!!! thanks for helping us. ;)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure.
@marcspataru
@marcspataru 3 жыл бұрын
I have a really important interview tomorrow. If I remember I’ll come here and update.
@sexcommunist
@sexcommunist 3 жыл бұрын
Hey, how was your interview?
@vamsishankar2825
@vamsishankar2825 4 жыл бұрын
What is the gear you use for making these videos? Like the quality is excellent.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I think I addressed in a different comment, but not fully sure now I forgot. iPad...mic cover...some $50 mic off amazon (Samson QC50? not sure)
@vamsishankar2825
@vamsishankar2825 4 жыл бұрын
@@BackToBackSWE oh.. ok thanks.
@GeovaniLopesDias
@GeovaniLopesDias 5 ай бұрын
In english, LR and RL rotations are so intuitive! In Portuguese, I'm struggling to get what the heck a "double left" rotation looks like...
@TheRamdatta
@TheRamdatta 4 жыл бұрын
Hey dear, I'm working as a Manual test engineer currently, I wanted to switch to automation test engineer. I'd like to know how your tutorials could help me to step up. Thanks! Btw, I watched this video, It's sweet to learn DS again...
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I'm not sure to be honest. and thanks
@chudchadanstud
@chudchadanstud Жыл бұрын
Could you not flatten the tree, get the node with the value closest to the median and set it as the root?
@shine0nme135
@shine0nme135 3 жыл бұрын
absolutely loved the way you explain the concept here thanks a lot this really helps me
@adarshsharmanit356
@adarshsharmanit356 4 жыл бұрын
Welcome Back Brother ...Love from INDIA
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
love from 'MURICA 🚜🌽
@adarshsharmanit356
@adarshsharmanit356 4 жыл бұрын
@@BackToBackSWE Learnt new word "MURICA" LoL
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@adarshsharmanit356 nice
@0x1h0b
@0x1h0b 4 жыл бұрын
thank god !!.. finally you are back.. good to see you buddy
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey.
@IStMl
@IStMl 3 жыл бұрын
finally a natural explanation
@chrispy808
@chrispy808 3 ай бұрын
Best explanation of this thank you!
@kirillzlobin7135
@kirillzlobin7135 Жыл бұрын
12:45 How did we fix the balance if the tree became heavy on the other side
@pietasharp
@pietasharp 2 жыл бұрын
what is high of tree when on right side i see 2 nodes and left 2 nodes plus 1 note on the top? H(Tr)+1=2+1=3?
@itskingshon
@itskingshon 2 жыл бұрын
Your tutorials save me every time!
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thank You, Glad you liked it. Do check out backtobackswe.com/platform/content and please recommend us to your family and friends :)
@moosegoose1282
@moosegoose1282 3 жыл бұрын
i exited out my prof zoom lecture to watch this. thank u
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
haha! try our free mini course to explore more cool stuff - backtobackswe.com/
@gcraneorigami
@gcraneorigami 3 жыл бұрын
Absolutely stellar explanation
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thx
@prohunter191111
@prohunter191111 2 жыл бұрын
Your explanation was very clear, thank you very much you helped me a lot
@Wolverine_261
@Wolverine_261 2 ай бұрын
Can't find C++ programs for AVL on your website
@cocoarecords
@cocoarecords 4 жыл бұрын
The legend is back with a new video
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I am normal.
@joshreynolds4164
@joshreynolds4164 4 жыл бұрын
he's back!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey. I never left, just been working on backtobackswe.com.
@KanekiSidibe
@KanekiSidibe 2 жыл бұрын
This tutorial is awesome, since there is no dislike button, I just let you know in advance !
@kllau719
@kllau719 2 жыл бұрын
This video really helped me to understand AVL tree! thanksssss :)
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Great!
@LighterST
@LighterST 4 жыл бұрын
Amazing explanation, yet a code breakdown would really come in handy (btw, still no C++ solution at the site)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
noted and noted
@リンゴ酢-b8g
@リンゴ酢-b8g 2 жыл бұрын
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.
@brainwizard8915
@brainwizard8915 3 жыл бұрын
Wow what a sleek explanation
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
haha
@polycoder
@polycoder 2 жыл бұрын
which program does he use for writing?
@patrickneff7846
@patrickneff7846 Жыл бұрын
Great explanation. Very clear, thanks.
@BackToBackSWE
@BackToBackSWE Жыл бұрын
thanks, glad it helped! There are other codes at - backtobackswe.com/ check it out. Would love some feedback
@jkim5118
@jkim5118 4 жыл бұрын
Welcome back, Ben!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey.
@jkim5118
@jkim5118 4 жыл бұрын
@@BackToBackSWE Yo Ben, is the discussion section on BTB SWE still active? I've posted some questions on this video.
@monjasonsteng7861
@monjasonsteng7861 18 күн бұрын
Thank you - this was great!
@farhan787
@farhan787 4 жыл бұрын
Most awaited video, thanks Benyam ❤❤
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure.
@debadritatalapatra5888
@debadritatalapatra5888 4 жыл бұрын
Could you please make a video on explaining the problem - 'Find the kth largest element in N sorted arrays' ? That'll really be helpful.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
yes
@debadritatalapatra5888
@debadritatalapatra5888 4 жыл бұрын
Thanks! Looking forward to it ;)
@TrueDetectivePikachu
@TrueDetectivePikachu 2 жыл бұрын
right in 6:09 I decided to just pause and get to code to see if I can understand it. I ended up with something not very stable but it works XD Done in Python, I'm not sure if this may be O(n log n), it prolly depends on how bad the tree that is traversing is class Node(object): def __init__(self, data=None): self.data: object = data self.left: Node = None self.right: Node = None def get_height(b: Node): def inner(b: Node): if b is None: return -1 return max(inner(b.left), inner(b.right)) + 1 return abs(inner(b.left) - inner(b.right))
@TrueDetectivePikachu
@TrueDetectivePikachu 2 жыл бұрын
still figuring out how to implement the rotation btw, ended in either a stack overflow or loosing a bunch of nodes along the way
@WrongNicholas
@WrongNicholas 9 ай бұрын
helping me through data structures
@BackToBackSWE
@BackToBackSWE 9 ай бұрын
Happy Holidays 🎉 Thank you for your kind words, Wrongnicholas! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@niklotios
@niklotios 4 жыл бұрын
Can you please explain why you inserted the nodes the way you did in the examples about rotations? Or show me a video of the information that I am missing. Thanks a lot!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
what is confusing i can explain
@niklotios
@niklotios 4 жыл бұрын
@@BackToBackSWE no worries I just hadn't understood the insertion in a binary search tree. I learned it and have passed the exam now. Thanks a lot!!
@namanmalhotra7485
@namanmalhotra7485 4 жыл бұрын
Your videos are awesome...Please launch a competitive programming course..💁
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks and I personally can't
@user-zm3uw5ij9r
@user-zm3uw5ij9r 4 жыл бұрын
please do a video on explaining the red black tree.....and comparision of red black tree and avl tree
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
maybe.
@sameerplaynicals8790
@sameerplaynicals8790 2 жыл бұрын
11:20 the purple node can't be equal to y, because the insertion condition was, smaller=left, bigger or equal to=right.
@ghostfjdgcsusvsgsj
@ghostfjdgcsusvsgsj Жыл бұрын
Thanks for the great explanation
@HoTuMinuet
@HoTuMinuet Ай бұрын
holly crap your explanation is spot on! thanks a lot
@tmusic591
@tmusic591 3 жыл бұрын
"We have looked at binary search trees before" I deliberately clicked on the Video in the Playlist marked as #1. Which is the video that I actually should start with? Is there a sorted playlist regarding topics? I appears to me that every video sais "we did X before" and I wonder where I should actually start.
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
You could explore the entire set of video content on DSA by getting a full fledged subscription on the Back To Back website - backtobackswe.com/pricing
@programming2347
@programming2347 2 жыл бұрын
You know, I've been working with btrees for a while and Im not really sure if its necessary to strictly implement these rotations in order to get to an avl tree. Since all what you do in composed rotations is convert them into single rotation cases first to then apply that single rotation step. But what if we just add the unbalance Node to its next subtree. And repeat recursively the wrapper method to balance that new subtree. I mean if you have the case for a BTree like the next one. 2---- | ------------ 12 ----------- | | ---- 6 ---- 15 | | 5 8 *Node 2* (HeadNode) is unbalanced by a factor of 3 Couldnt we just move all the subTree of Node 12 one level up and then add the *Node 2* to that new Resulting Tree. So It would result as: ------------ 7----------- | | ---- 6---- 10 | | ---5 8 | 2 This is balanced Tree already, And now this Tree with Node 7 as the headNode would enter to the balanceTree Method again. To make sure there are no unbalanced nodes after the last change. Its the same Case when you have a Tree Like this: 2---- | 3--- | 5 You just have to take the Node 2 and insert it into the subTree with Node 3 as the HeadNode, So It will became into: --- 3 --- | | 2 5 And then we have the special rotation case: --------- 5 | 3---- | 4 This is a double rotation case, but if you just shift the subTree with Node 3 as HeadNode and insert the Node 5 into that subTree You would already have a single rotation case: 3 ---- | 4 ---- | 5 And if we repeat Sending Node 3 into the BalanceTree Method... SubTree with Node 4 as HeadNode would be already balanced once you do the insertion of Node 3 into it --- 4 --- | | 3 5 I've noticed that in the worst of the cases the new Tree is going to be unbalanced again and you can recursively submit the resulting subtrees untill all the unbalanced nodes are just single rotation cases. But usually with much less steps than implementing the double rotations. Is there any specific or algorithmic reason that makes these 2 special double rotation nodes to be the mandatory way to balance every unbalanced subtree? Or do you think the method Im using would be legit and as effective as the one with the rotations. Im not sure if Im making myself clear with this. But its a simple step to get a balanced Tree. - Just take the unbalance Node and insert it into its child SubTree. (Delegating some of the work to the InsertNode Method) Maybe its a more intuitive solution for me. It just came to my mind watching your video so I wouldn't be able to say that this method has math or algorithm well based basis. So I would be really glad if you tell me like "No dude, there's a problem with that and its..." or whatever. Thank you for your deep explanation
@Yoavlevavi
@Yoavlevavi 2 ай бұрын
This video saved me 40 min before my test. T
@Yoavlevavi
@Yoavlevavi 2 ай бұрын
thanks!!
@arrahul316
@arrahul316 4 жыл бұрын
Thanks bro....this is a great content. It will be useful if we have an example where we have say 5 or greater number of nodes and left or right right heavy with left->right or right->left rotation explained. Again, many thanks for this content. You just rock.. Another suggestion is whether we could explain some practical applications of each DS/Alg as and when you cover them in each video. Like now I know what is AVL tree's properties-> Self balancing. Now where is this Self balancing mandatory in some real world problems. Yes we could google this out or get from intuition. But it will be good conclusion to any video you present, once you have this explained. Again, just a thought. Not an absolute requirement. Thanks Bro. Have a good one!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure - ok, and u too
@meloth01
@meloth01 2 жыл бұрын
short and precise thank you
10.1 AVL Tree - Insertion and Rotations
43:08
Abdul Bari
Рет қаралды 1,2 МЛН
Lecture 6: AVL Trees, AVL Sort
51:59
MIT OpenCourseWare
Рет қаралды 667 М.
Expected Ending?
00:45
ISSEI / いっせい
Рет қаралды 9 МЛН
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 129 МЛН
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
The Most Elegant Search Structure | (a,b)-trees
11:38
Tom S
Рет қаралды 37 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
The Boundary of Computation
12:59
Mutual Information
Рет қаралды 1 МЛН
AVL Tree 7 complete example of adding data to an AVL tree.
20:47
AVL trees in 9 minutes - Insertions
9:00
Michael Sambol
Рет қаралды 42 М.
Expected Ending?
00:45
ISSEI / いっせい
Рет қаралды 9 МЛН