<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AVL balance factor Archives - NeuralLantern.com</title>
	<atom:link href="https://www.NeuralLantern.com/tag/avl-balance-factor/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.NeuralLantern.com/tag/avl-balance-factor/</link>
	<description></description>
	<lastBuildDate>Tue, 16 Jun 2026 04:49:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.NeuralLantern.com/wp-content/uploads/2025/04/cropped-2025-04-04-Lantern-03-32x32.png</url>
	<title>AVL balance factor Archives - NeuralLantern.com</title>
	<link>https://www.NeuralLantern.com/tag/avl-balance-factor/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>AVL Tree Rotations Practice: Balancing a Huge Linear Tree Step by Step</title>
		<link>https://www.NeuralLantern.com/avl-tree-rotations-practice-balancing-a-huge-linear-tree-step-by-step/</link>
					<comments>https://www.NeuralLantern.com/avl-tree-rotations-practice-balancing-a-huge-linear-tree-step-by-step/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Tue, 16 Jun 2026 04:49:15 +0000</pubDate>
				<category><![CDATA[AVL Trees]]></category>
		<category><![CDATA[Binary Search Trees]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[AVL balance factor]]></category>
		<category><![CDATA[avl rotations]]></category>
		<category><![CDATA[AVL tree]]></category>
		<category><![CDATA[balanced binary tree]]></category>
		<category><![CDATA[binary search tree]]></category>
		<category><![CDATA[bst]]></category>
		<category><![CDATA[coding interview]]></category>
		<category><![CDATA[computer science tutorial]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[rotation examples]]></category>
		<category><![CDATA[self balancing tree]]></category>
		<category><![CDATA[tree rotations]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=391</guid>

					<description><![CDATA[<p>Learn how to perform AVL tree rotations on a completely linear binary search tree. This step-by-step practice video shows multiple rotations, balance factor updates, and how to transform an unbalanced O(n) tree into a balanced O(log n) AVL tree.</p>
<p>The post <a href="https://www.NeuralLantern.com/avl-tree-rotations-practice-balancing-a-huge-linear-tree-step-by-step/">AVL Tree Rotations Practice: Balancing a Huge Linear Tree Step by Step</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="AVL Tree Rotations Practice: Balancing a Huge Linear Tree Step by Step" width="1380" height="776" src="https://www.youtube.com/embed/mykKNhayTJM?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">In this hands-on AVL tree tutorial, we take a massive unbalanced linear binary search tree and perform multiple rotations to turn it into a properly balanced AVL tree. Watch as we identify imbalance, label X Y Z nodes, determine A B C, handle outstanding children, and reattach subtrees step by step.</p>



<p class="wp-block-paragraph">Perfect for computer science students learning data structures, self-balancing trees, and AVL rotations. We go through several rotations on the same tree to show the full process from start to finish.</p>



<p class="wp-block-paragraph">If you&#8217;ve seen the basics, this is the practice video you&#8217;ve been looking for. Timestamps and clear diagrams included.</p>



<p class="wp-block-paragraph">Like and subscribe for more data structures content!</p>



<p class="wp-block-paragraph">00:00 Introduction to AVL Rotations Practice<br>00:22 Previous Videos Overview<br>00:56 Understanding the Linear Tree Problem<br>01:24 Why Balance This Tree<br>02:20 Computing Balance Factors<br>03:16 First Rotation Setup XYZ<br>04:04 In-Order ABC Pattern<br>05:50 Reattaching Subtree<br>07:17 Recompute Balance Factors<br>08:06 Second Rotation Setup<br>09:20 XYZ and ABC for Second Rotation<br>10:08 Drawing Output Pattern<br>11:40 Placing Outstanding Children<br>13:32 Third Rotation Setup<br>14:28 XYZ for Third Rotation<br>15:02 Output Pattern and Children<br>18:28 Recompute Balance Factors<br>19:28 Fourth Rotation Setup<br>20:04 XYZ for Final Rotation<br>20:32 Handling All Outstanding Children<br>23:20 Reattaching Final Subtree<br>24:50 Last Rotation Setup<br>25:48 XYZ and ABC Final<br>26:38 Output Pattern and Children Placement<br>30:16 Final Balance Factors Check<br>30:52 Valid AVL Tree Achieved<br>31:07 Conclusion and Thanks</p>



<p class="wp-block-paragraph">=-=-=-=-=-=-=-=-=</p>



<p class="wp-block-paragraph">Thanks for watching!</p>



<p class="wp-block-paragraph">Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>



<li>Twitter / X: https://x.com/NeuralLantern</li>



<li>Rumble: https://rumble.com/c/c-3696939</li>



<li>BitChute: https://www.bitchute.com/channel/pg1Pvv5dN4Gt</li>



<li>Daily Motion: https://www.dailymotion.com/neurallantern</li>



<li>Minds: https://www.minds.com/neurallantern/</li>



<li>Odysee: https://odysee.com/@NeuralLantern:5</li>
</ul>



<p class="wp-block-paragraph">Please show your support!</p>



<ul class="wp-block-list">
<li>Buy me a coffee: https://ko-fi.com/neurallantern</li>



<li>Subscribe + Sharing on Social Media</li>



<li>Leave a comment or suggestion</li>



<li>Subscribe to the Blog: https://www.NeuralLantern.com</li>



<li>Watch the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p class="wp-block-paragraph">Hello there! Let&#8217;s practice AVL rotations with a big ugly gross linear tree that for some reason hasn&#8217;t been rotating up to this point.</p>



<p class="wp-block-paragraph">But we&#8217;re going to rotate it all at once to make it nice and balanced per the rules of AVL trees, just for practice.</p>



<p class="wp-block-paragraph">Okay, so first off, you should have hopefully seen my previous videos.</p>



<p class="wp-block-paragraph">search trees how to define them how to build them search through them add remove stuff all that</p>



<p class="wp-block-paragraph">stuff and then we talked about abl trees which are really just self-balancing binary search</p>



<p class="wp-block-paragraph">trees with some extra special rules on top we talked about the types of rotations how to do</p>



<p class="wp-block-paragraph">the rotations when to rotate when to how to detect whether a tree is actually a valid abl tree and</p>



<p class="wp-block-paragraph">all that stuff so if you don&#8217;t know what i&#8217;m talking about see my previous videos otherwise</p>



<p class="wp-block-paragraph">we&#8217;re just going to practice on this one tree right now we&#8217;re just going to do a practice run</p>



<p class="wp-block-paragraph">run. Okay so you would never I mean you would hopefully never see an AVL tree</p>



<p class="wp-block-paragraph">that looks like this. This is way too imbalanced for an AVL tree. An AVL tree</p>



<p class="wp-block-paragraph">would have started rebalancing itself a long time ago but let&#8217;s just pretend for</p>



<p class="wp-block-paragraph">the sake of argument that you disabled the balancing feature of your AVL tree.</p>



<p class="wp-block-paragraph">You maybe like have a boolean inside of your class that you&#8217;ve written in your</p>



<p class="wp-block-paragraph">program called am I behaving like an AVL tree true or false and you set it to</p>



<p class="wp-block-paragraph">for a while then you started throwing nodes at the tree after you ended up with this giant linear</p>



<p class="wp-block-paragraph">tree then we&#8217;re going to suddenly turn on the avlness bool and start rotating this tree sucks</p>



<p class="wp-block-paragraph">this is a valid binary search tree but like if you notice it follows all the rules of a binary</p>



<p class="wp-block-paragraph">search tree and the data is in order but this is definitely not a valid avl tree the time</p>



<p class="wp-block-paragraph">complexity of searching through this tree would be o of h and since o of h is actually the number</p>



<p class="wp-block-paragraph">h is actually the number of nodes in the entire tree the time complexity of</p>



<p class="wp-block-paragraph">searching through this particular tree is o of n so this is a linear tree it&#8217;s</p>



<p class="wp-block-paragraph">no faster to search through than a linked list at least in terms of</p>



<p class="wp-block-paragraph">scalability so this is bad we need to fix this so now let&#8217;s turn on the AVL</p>



<p class="wp-block-paragraph">ness we&#8217;ll say okay now you&#8217;re no longer pretending to be a regular binary search</p>



<p class="wp-block-paragraph">tree you&#8217;re an AVL tree let&#8217;s do some rotations the first thing we should do</p>



<p class="wp-block-paragraph">do if you&#8217;re presented with a tree like this all at once is just compute the balance factors for</p>



<p class="wp-block-paragraph">every single node. So I&#8217;m going to say the 55 is a leaf it has a balance factor of 0, the 42 has a</p>



<p class="wp-block-paragraph">balance factor of 1, and really the balance factors just increase by 1 for every level up we go. So</p>



<p class="wp-block-paragraph">the balance factor of the 15 node is horrible, it&#8217;s really really really bad. Now that we&#8217;ve done</p>



<p class="wp-block-paragraph">this we could rotate anywhere we wanted to. I mean it&#8217;s valid to rotate starting with the 34 or the</p>



<p class="wp-block-paragraph">or the 27 or 22 or 15 you wouldn&#8217;t want to rotate the 42 because that&#8217;s not</p>



<p class="wp-block-paragraph">imbalanced enough for an AVL tree but really the smartest thing to do is</p>



<p class="wp-block-paragraph">rotate as low as possible because when you rotate stuff that&#8217;s lower it tends</p>



<p class="wp-block-paragraph">to fix stuff that&#8217;s higher so then you&#8217;ll end up doing less work and</p>



<p class="wp-block-paragraph">probably end up with a tree that matches what someone else expected okay so we&#8217;re</p>



<p class="wp-block-paragraph">going to rotate as low as possible that means I&#8217;m going to find the lowest node</p>



<p class="wp-block-paragraph">and I&#8217;m going to say it&#8217;s the 34 node and I&#8217;ll label that as Z.</p>



<p class="wp-block-paragraph">That&#8217;s bad. Let me try again.</p>



<p class="wp-block-paragraph">34 is Z.</p>



<p class="wp-block-paragraph">Okay, then we find the A child of the Z node</p>



<p class="wp-block-paragraph">and we have to find the child that has a taller subtree,</p>



<p class="wp-block-paragraph">but there&#8217;s only one choice.</p>



<p class="wp-block-paragraph">We can only go to the right.</p>



<p class="wp-block-paragraph">There&#8217;s nothing on the left.</p>



<p class="wp-block-paragraph">So that means Y is the 42 node.</p>



<p class="wp-block-paragraph">Same thing for the X node.</p>



<p class="wp-block-paragraph">We&#8217;re labeling for X and we have to find a child of Y.</p>



<p class="wp-block-paragraph">We have to look at the taller subtree,</p>



<p class="wp-block-paragraph">We have to look at the taller subtree, but there is no other choice.</p>



<p class="wp-block-paragraph">We can only go down and to the right.</p>



<p class="wp-block-paragraph">So now we know our XYZ.</p>



<p class="wp-block-paragraph">I&#8217;m just going to place these labels up here at the top.</p>



<p class="wp-block-paragraph">I&#8217;m going to say X is 55, Y is 42, and Z is 34.</p>



<p class="wp-block-paragraph">And maybe I&#8217;m going to change that text color real fast.</p>



<p class="wp-block-paragraph">Then we want to produce an in-order representation of XYZ.</p>



<p class="wp-block-paragraph">This step, I think it helps people with diagrams, but it also helps you a lot when it comes time to code.</p>



<p class="wp-block-paragraph">when it comes time to code,</p>



<p class="wp-block-paragraph">because coding for these rotations is way easier</p>



<p class="wp-block-paragraph">than diagramming these rotations.</p>



<p class="wp-block-paragraph">You pretty much just have to come up with three new pointers,</p>



<p class="wp-block-paragraph">A and B and C,</p>



<p class="wp-block-paragraph">and all they are is the ordered version of XYZ.</p>



<p class="wp-block-paragraph">So, you know, which node belongs on the very left,</p>



<p class="wp-block-paragraph">that&#8217;s gonna be 34,</p>



<p class="wp-block-paragraph">which node would belong in the middle,</p>



<p class="wp-block-paragraph">that&#8217;s gonna be 42,</p>



<p class="wp-block-paragraph">which node would belong on the right side,</p>



<p class="wp-block-paragraph">that&#8217;s gonna be 55.</p>



<p class="wp-block-paragraph">And so now we&#8217;re ready to come up with our output pattern.</p>



<p class="wp-block-paragraph">So I&#8217;m just gonna take one of these nodes</p>



<p class="wp-block-paragraph">So I&#8217;m just going to take one of these nodes and copy it.</p>



<p class="wp-block-paragraph">Maybe get rid of that little stem there.</p>



<p class="wp-block-paragraph">And then I&#8217;m going to just, you know, copy paste this a couple of times as quickly as I can.</p>



<p class="wp-block-paragraph">It doesn&#8217;t need to be perfect.</p>



<p class="wp-block-paragraph">But if it&#8217;s not, they&#8217;ll laugh at you.</p>



<p class="wp-block-paragraph">Okay.</p>



<p class="wp-block-paragraph">So we&#8217;ll do this.</p>



<p class="wp-block-paragraph">And we&#8217;ll draw some connecting lines.</p>



<p class="wp-block-paragraph">So we&#8217;ve got like three nodes here.</p>



<p class="wp-block-paragraph">A perfect little tri-node subtree because we picked X and Y and Z.</p>



<p class="wp-block-paragraph">because we picked X and Y and Z and that became A and B and C.</p>



<p class="wp-block-paragraph">Can&#8217;t get that line right, I&#8217;m going to give up.</p>



<p class="wp-block-paragraph">So then we, I&#8217;m going to fix the labels here. So what is A belonging on the left?</p>



<p class="wp-block-paragraph">That&#8217;s 34. What is B which belongs in the middle? That&#8217;s 42.</p>



<p class="wp-block-paragraph">What is C which belongs on the right? That&#8217;s 55. So now we have</p>



<p class="wp-block-paragraph">a perfectly balanced trinode subtree. Notice how this is a valid binary search tree.</p>



<p class="wp-block-paragraph">If the numbers were in a different order, this wouldn&#8217;t be</p>



<p class="wp-block-paragraph">a valid binary search tree and you&#8217;d have to try again with your ordering and also this has to be</p>



<p class="wp-block-paragraph">a perfectly balanced trinode subtree otherwise this probably wouldn&#8217;t actually help if we if</p>



<p class="wp-block-paragraph">we did a different output pattern it wouldn&#8217;t help the tree so then the next thing we need to do is</p>



<p class="wp-block-paragraph">just double check that we don&#8217;t have any nodes that are unaccounted for from the input pattern</p>



<p class="wp-block-paragraph">the xyz nodes so if we look at the uh the 34 node let&#8217;s look at z first i guess we&#8217;ll look at the 34</p>



<p class="wp-block-paragraph">had 42 as a child but 42 is already handled so that&#8217;s actually okay then we look at the y node</p>



<p class="wp-block-paragraph">that&#8217;s 42 it had 34 and 55 as children the 34 was handled uh here and the 55 is handled here so we</p>



<p class="wp-block-paragraph">actually are fine we don&#8217;t need to worry about that now we&#8217;ll look at the x node the x node had</p>



<p class="wp-block-paragraph">no children so we&#8217;re pretty much done again like i said in previous videos there could have been up</p>



<p class="wp-block-paragraph">You know, each of these XYZ nodes could have had its own children.</p>



<p class="wp-block-paragraph">Notice how 34 could have had one, 42 could have had one, 55 could have had two.</p>



<p class="wp-block-paragraph">So there would be four outstanding children.</p>



<p class="wp-block-paragraph">So we&#8217;re actually done at this point with the outstanding children.</p>



<p class="wp-block-paragraph">There are none.</p>



<p class="wp-block-paragraph">So I&#8217;m ready to reattach this tree, I guess the rotated subtree, into the regular tree.</p>



<p class="wp-block-paragraph">So these three nodes can just go away from our diagram.</p>



<p class="wp-block-paragraph">In code, you&#8217;re not actually removing these nodes.</p>



<p class="wp-block-paragraph">You&#8217;re just sort of, you know, reattaching pointers.</p>



<p class="wp-block-paragraph">reattaching pointers but I&#8217;m going to redraw this in a way that looks kind of nice and I&#8217;ll just</p>



<p class="wp-block-paragraph">maybe redo this line real fast so I&#8217;m going to do a blue line here okay now we have to recompute the</p>



<p class="wp-block-paragraph">balance factors so I&#8217;m going to say that the 34 is a leaf it&#8217;s got balance factor of zero same for</p>



<p class="wp-block-paragraph">perfectly balanced and then we have to work our way up until we reach the root node. So</p>



<p class="wp-block-paragraph">the 27 node, it&#8217;s got two nodes hanging off the right side and nothing on the left.</p>



<p class="wp-block-paragraph">So its new balance factor is two. So it actually improved a little bit.</p>



<p class="wp-block-paragraph">The 22 node, one, two, three, it&#8217;s got three nodes hanging off the right side and nothing</p>



<p class="wp-block-paragraph">on the left. So it improved a little bit to three. And I&#8217;m guessing that the 15 also improved to four.</p>



<p class="wp-block-paragraph">You can see the height on the left subtree of 15 is one, two, three, four, nothing on the left,</p>



<p class="wp-block-paragraph">So we&#8217;re done with this particular rotation.</p>



<p class="wp-block-paragraph">But because we see a node that has a balance factor of two or worse,</p>



<p class="wp-block-paragraph">we&#8217;re not actually done rotating.</p>



<p class="wp-block-paragraph">This is still an invalid AVL tree.</p>



<p class="wp-block-paragraph">And under the hood, we would continually just, you know, rotate up and up and up the tree</p>



<p class="wp-block-paragraph">until everything looked like it was fixed.</p>



<p class="wp-block-paragraph">So again, the first node that&#8217;s out of whack, or I guess the lowest node that&#8217;s out of whack,</p>



<p class="wp-block-paragraph">we&#8217;ll call that our Z node.</p>



<p class="wp-block-paragraph">So we&#8217;re going to put a Z here.</p>



<p class="wp-block-paragraph">piece of text and then we have to find a child of Z with the tallest subtree so there&#8217;s no child on</p>



<p class="wp-block-paragraph">the left which means we have to go to the right to find our Y node okay then we have to go find X</p>



<p class="wp-block-paragraph">through a child of Y and we have to find the child with the taller subtree actually the left child</p>



<p class="wp-block-paragraph">and the right child have the same height of their trees of their subtrees so it doesn&#8217;t actually</p>



<p class="wp-block-paragraph">know for fun let&#8217;s just go to the left because it&#8217;ll probably be harder we&#8217;ll say that the x</p>



<p class="wp-block-paragraph">node is 34. be consistent if you always whenever you see like sub trees that are equal height</p>



<p class="wp-block-paragraph">i don&#8217;t know maybe try to be consistent going left or right but in this case it doesn&#8217;t really matter</p>



<p class="wp-block-paragraph">so we have xyz i&#8217;m going to type them up again right here we&#8217;re going to say x equals</p>



<p class="wp-block-paragraph">Let me just double check that 34 42 27 and then we&#8217;ll produce ABC, which are the in order</p>



<p class="wp-block-paragraph">representations of XYZ.</p>



<p class="wp-block-paragraph">Again, imagine you&#8217;re using pointers if you&#8217;re doing this in code.</p>



<p class="wp-block-paragraph">So we have like a is equal to the least value, the one that would belong on the left.</p>



<p class="wp-block-paragraph">That&#8217;s the 27 B should be 34 and C should be 42.</p>



<p class="wp-block-paragraph">And then, you know, just visually check.</p>



<p class="wp-block-paragraph">way so that all the nodes have their own space. The one that&#8217;s furthest on the left is Z and that</p>



<p class="wp-block-paragraph">ends up being A. The one in the middle is X, that&#8217;s B, and the one on the right is C, that&#8217;s 42, Y.</p>



<p class="wp-block-paragraph">Right, yeah. Okay, so now that we&#8217;ve selected our ABC we can start drawing the output pattern. So</p>



<p class="wp-block-paragraph">I&#8217;m going to like make a little copy of this and I&#8217;m just going to very quickly try to draw</p>



<p class="wp-block-paragraph">balanced maybe a little bit lower they&#8217;ll laugh at you um they won&#8217;t they will i&#8217;m just kidding</p>



<p class="wp-block-paragraph">let me finish this line</p>



<p class="wp-block-paragraph">all right fix the numbers real fast uh so a is supposed to be on the left so that&#8217;s 27 that&#8217;s</p>



<p class="wp-block-paragraph">already good uh b is 34 c is 42 so now we have to just worry about the unaccounted for children of</p>



<p class="wp-block-paragraph">unaccounted for children of ABC or XYZ. So first I&#8217;m going to look at X. Whoops.</p>



<p class="wp-block-paragraph">We look at X, it&#8217;s 34. It had no children of its own, so we don&#8217;t even have to worry about any of</p>



<p class="wp-block-paragraph">its children. So we&#8217;re done. We look at Y, Y had two children. It had 34, but 34 was already handled</p>



<p class="wp-block-paragraph">up here. And it had a right child of 55. Oh, so we have a child that is unaccounted for now. So I&#8217;m</p>



<p class="wp-block-paragraph">duplicate it over here. We got to put it somewhere. I don&#8217;t know where just yet.</p>



<p class="wp-block-paragraph">You can probably figure it out, but I&#8217;m just going to put it over there. Now we&#8217;re done looking for the Y.</p>



<p class="wp-block-paragraph">And then next we&#8217;ll look at the Z node.</p>



<p class="wp-block-paragraph">So I&#8217;m going to do</p>



<p class="wp-block-paragraph">the Z node is 27. It had a 42 as a right child, but 42 was already handled in the output pattern.</p>



<p class="wp-block-paragraph">So we&#8217;re done looking for outstanding children.</p>



<p class="wp-block-paragraph">So the next thing I&#8217;m going to do is figure out where the heck does that 55 go?</p>



<p class="wp-block-paragraph">does that 55 go? Remember, we&#8217;re trying to make valid binary search trees, which means there&#8217;s</p>



<p class="wp-block-paragraph">only one place where this 55 node could actually go. If you stuck it on the left side, a greater</p>



<p class="wp-block-paragraph">value on the left of 27, that&#8217;s invalid. That wouldn&#8217;t work. 55 is greater than 34, so it can&#8217;t</p>



<p class="wp-block-paragraph">go on the left. It&#8217;s greater than 42. So actually 55 belongs all the way on the right side, because</p>



<p class="wp-block-paragraph">again, that&#8217;s the only place it would actually work to allow us to still have a valid binary</p>



<p class="wp-block-paragraph">search tree when we were done placing it so double check the subtree that you have written down after</p>



<p class="wp-block-paragraph">you&#8217;re done doing all this stuff and make sure that the whole entire tree is a valid binary search</p>



<p class="wp-block-paragraph">tree if not you probably have to try again okay so i&#8217;m going to duplicate this slide right here</p>



<p class="wp-block-paragraph">and we&#8217;re going to say that we&#8217;ve got four nodes ready to be inserted in place of these four nodes</p>



<p class="wp-block-paragraph">over here one two three four so i&#8217;m going to just select all four of these nodes and just delete them</p>



<p class="wp-block-paragraph">and reinsert the rotated, you know, the rotated nodes, which are the same nodes, but they&#8217;re just,</p>



<p class="wp-block-paragraph">you know, they&#8217;re drawn differently with, you know, different connections. And then I&#8217;m going</p>



<p class="wp-block-paragraph">to fix this connection over here. So that&#8217;s 34 is now the right child of 22. Then I have to do</p>



<p class="wp-block-paragraph">the balance factors for all of the nodes that we rearranged. So the leaves are easy. As usual,</p>



<p class="wp-block-paragraph">This 42 has a balance factor of 1, and this 34 has a balance factor of also 1.</p>



<p class="wp-block-paragraph">It&#8217;s not perfect, but it&#8217;s okay.</p>



<p class="wp-block-paragraph">Then we work our way up the tree until we find the root node.</p>



<p class="wp-block-paragraph">So now we&#8217;re going to recompute the balance factor for the 22.</p>



<p class="wp-block-paragraph">Actually, it doesn&#8217;t improve.</p>



<p class="wp-block-paragraph">If you notice, the right subtree has a height of 1, 2, 3.</p>



<p class="wp-block-paragraph">There is no left subtree, so the balance factor is 3.</p>



<p class="wp-block-paragraph">Same thing for this 15 node.</p>



<p class="wp-block-paragraph">So we made a little progress.</p>



<p class="wp-block-paragraph">Not much.</p>



<p class="wp-block-paragraph">We have to keep going.</p>



<p class="wp-block-paragraph">So, you know, once again, I&#8217;m going to select the lowest node that&#8217;s out of whack.</p>



<p class="wp-block-paragraph">Or I guess as I work my way up the subtree, I can see that three node is still out of whack.</p>



<p class="wp-block-paragraph">So I&#8217;m going to call that Z.</p>



<p class="wp-block-paragraph">Nope.</p>



<p class="wp-block-paragraph">Somebody remind me to do what types of rotations to talk about the rotation types.</p>



<p class="wp-block-paragraph">Somebody send me an email or a comment.</p>



<p class="wp-block-paragraph">I&#8217;m going to do it at the end of this video, but send me a comment anyway.</p>



<p class="wp-block-paragraph">So the Z node is the 22 node.</p>



<p class="wp-block-paragraph">22 node to find the y node we have to take a child of z with the tallest subtree but that&#8217;s obviously going to be 34</p>



<p class="wp-block-paragraph">There&#8217;s no other choice</p>



<p class="wp-block-paragraph">And now we actually do have an interesting choice to find the x node</p>



<p class="wp-block-paragraph">It has to be a child of y, but it&#8217;s got to be the child with the tallest subtree</p>



<p class="wp-block-paragraph">So for the first time we can kind of see</p>



<p class="wp-block-paragraph">That we you know, we might have wanted to put x on the left or right, but it has to be on the right</p>



<p class="wp-block-paragraph">We&#8217;re not allowed to put it on on the left at least for this method</p>



<p class="wp-block-paragraph">So there we go. We have our XYZ. I&#8217;m going to go ahead and do X is equal to 42, and Y is equal to 34, and Z is equal to 22, and then A, B, and C are going to be the in-order representations.</p>



<p class="wp-block-paragraph">the middle 42 goes on the right so now i&#8217;m ready to draw my output pattern so i&#8217;m going to like</p>



<p class="wp-block-paragraph">select this real fast duplicate it up here make some copies making copies anyone no okay just</p>



<p class="wp-block-paragraph">just wondering okay i&#8217;m going to do this do some connecting lines</p>



<p class="wp-block-paragraph">So A is supposed to be on the left, that&#8217;s 22, and then B is going to be 34, and C is</p>



<p class="wp-block-paragraph">going to be on the right, that&#8217;s going to be 42.</p>



<p class="wp-block-paragraph">So we have a perfectly balanced trinode subtree.</p>



<p class="wp-block-paragraph">Now we&#8217;ve got to double check for outstanding children.</p>



<p class="wp-block-paragraph">So we start by looking at the Z node.</p>



<p class="wp-block-paragraph">Oh my god.</p>



<p class="wp-block-paragraph">Not as skilled as I think I am.</p>



<p class="wp-block-paragraph">We look at the Z node.</p>



<p class="wp-block-paragraph">which is already handled over here so we&#8217;re fine that way then we&#8217;ll look at the y node the y node</p>



<p class="wp-block-paragraph">was 34 it had a left child of 27 that is not accounted for in the output pattern so i&#8217;m going</p>



<p class="wp-block-paragraph">to grab it and then also you know when you&#8217;re grabbing these unaccounted for children double</p>



<p class="wp-block-paragraph">check that they might also have children of their own if they do we have to take them with the node</p>



<p class="wp-block-paragraph">that we&#8217;re moving so if 27 had any children we would not be you know removing or rearranging</p>



<p class="wp-block-paragraph">children and just kind of you know let them stay in their position underneath 27. You know we would</p>



<p class="wp-block-paragraph">not rearrange pointers that are further down but in this case what have I done in this case 27</p>



<p class="wp-block-paragraph">doesn&#8217;t have any children I&#8217;ll have to do a copy that&#8217;s why make a copy put it somewhere so now</p>



<p class="wp-block-paragraph">we&#8217;re done with the 27 on the right side of 34 it had a child of 42 but that&#8217;s already handled</p>



<p class="wp-block-paragraph">42 and then I&#8217;ll just put like an arrow here. Now we&#8217;re ready to look at the X nodes children.</p>



<p class="wp-block-paragraph">So the X is 42. It had a right child of 55 which is also not accounted for in the output pattern.</p>



<p class="wp-block-paragraph">So I&#8217;m going to just move that over here.</p>



<p class="wp-block-paragraph">Okay now we have to place these children in their appropriate positions.</p>



<p class="wp-block-paragraph">So the 55 if you think about it there&#8217;s only one position that the 55 could ever go</p>



<p class="wp-block-paragraph">go to produce a valid binary search tree so it can&#8217;t go there it&#8217;s got to go all the way on the</p>



<p class="wp-block-paragraph">right side so that&#8217;s where we&#8217;ll put it same thing for the 27 there&#8217;s only one place it could go it</p>



<p class="wp-block-paragraph">can&#8217;t go here because it&#8217;s less than 34 so it can&#8217;t be on the right side of 34 it&#8217;s going to</p>



<p class="wp-block-paragraph">be on the left side of 34 and if you look at where is it going to go with respect to 22 it can&#8217;t go</p>



<p class="wp-block-paragraph">on the left it has to go on the right because again we need a valid binary search tree</p>



<p class="wp-block-paragraph">So I&#8217;m just going to connect this line right here.</p>



<p class="wp-block-paragraph">And now we&#8217;re done making our little output tree, subtree.</p>



<p class="wp-block-paragraph">So how many nodes did we have in the input tree?</p>



<p class="wp-block-paragraph">It was 22, 34, 42, and 55, so like five nodes.</p>



<p class="wp-block-paragraph">And if you look at the output pattern here, there&#8217;s also five nodes.</p>



<p class="wp-block-paragraph">So we&#8217;re pretty much ready to just kind of remove all of these nodes</p>



<p class="wp-block-paragraph">all the way up to that 15.</p>



<p class="wp-block-paragraph">and make it the right child of 15. So I&#8217;m going to select all of this stuff, make it the right child</p>



<p class="wp-block-paragraph">of 15, and then I guess I&#8217;ll just redo that line real fast. So this is a nicely formatted diagram.</p>



<p class="wp-block-paragraph">So we&#8217;ll do what&#8217;s going on with my computer. Okay, sometimes it lags. I&#8217;m gonna, well,</p>



<p class="wp-block-paragraph">balance factors now so I&#8217;m going to do balance factors for the leaves pretty easy the 22 and the</p>



<p class="wp-block-paragraph">42 have a balance factor of one again if this is confusing see my previous videos we practiced a</p>



<p class="wp-block-paragraph">lot of that the balance factor for the 34 is going to be a zero remember it&#8217;s about the height of the</p>



<p class="wp-block-paragraph">left subtree versus the right subtree which there&#8217;s no difference actually they both have a height of</p>



<p class="wp-block-paragraph">two it&#8217;s you know just just because there&#8217;s a little diagonal bounce there on one side doesn&#8217;t</p>



<p class="wp-block-paragraph">awesome. Not perfect, but it&#8217;s pretty good. We look at the 15. What&#8217;s the new balance factor of</p>



<p class="wp-block-paragraph">the 15? It&#8217;s actually three now because the height of its right subtree is three and the height of</p>



<p class="wp-block-paragraph">its left subtree is zero. So its balance factor improved to three. So we are making, you know,</p>



<p class="wp-block-paragraph">a little bit of progress. Now we know that the only node that&#8217;s out of whack in the whole tree</p>



<p class="wp-block-paragraph">is the 15. So we&#8217;re just going to call that our Z node for another rotation. So I&#8217;m going to put Z</p>



<p class="wp-block-paragraph">of z which would be y and there&#8217;s no other choice and then once again we have to find a child of y</p>



<p class="wp-block-paragraph">to find x and we have to take the child that has the taller subtree but both of these subtrees</p>



<p class="wp-block-paragraph">are equal so i&#8217;m just going to go to the right for fun i don&#8217;t know i&#8217;m going to do x over here</p>



<p class="wp-block-paragraph">on the on the right side well hang on have i been doing this the easy way oh yeah let&#8217;s let&#8217;s go to</p>



<p class="wp-block-paragraph">Okay, so now we have XYZ. I don&#8217;t know why I say these things. We&#8217;ll do XYZ. X equals 22. Y is equal to 34. I say them for fun. Z is equal to 15. And then we&#8217;re going to do A and B and C. So A is going to be the least value. So that&#8217;s 15. B is going to be 22. C is going to be 34.</p>



<p class="wp-block-paragraph">tree so i&#8217;m going to copy this over here a couple more times this tree is probably going to be huge</p>



<p class="wp-block-paragraph">i&#8217;m probably gonna have to rearrange this a few times just do this over here make another copy</p>



<p class="wp-block-paragraph">over here there&#8217;s a lot of nodes that are going to be unaccounted for here um i think this was</p>



<p class="wp-block-paragraph">the example where we ended up just replacing the entire tree let&#8217;s see all right i guess that&#8217;s</p>



<p class="wp-block-paragraph">And then I&#8217;m going to update the numbers. So A is 15, and B is 22, and C is 34.</p>



<p class="wp-block-paragraph">So now one by one we have to look for any outstanding children of the nodes in the output pattern.</p>



<p class="wp-block-paragraph">So we look at, let&#8217;s say, the Z first.</p>



<p class="wp-block-paragraph">The Z had a right child of 34, but that&#8217;s already taken care of in the output pattern, so we don&#8217;t have to do anything.</p>



<p class="wp-block-paragraph">now we look at the y the y had a left child of 22 but that&#8217;s already taken care of in the output</p>



<p class="wp-block-paragraph">pattern so we don&#8217;t have to worry about that it also had a right child of 42</p>



<p class="wp-block-paragraph">um so we don&#8217;t have to worry about that sorry we do have to worry about that so i&#8217;m going to copy</p>



<p class="wp-block-paragraph">the 42 over here and we&#8217;re going to have to do something with it eventually now we&#8217;re ready to</p>



<p class="wp-block-paragraph">If we&#8217;re looking at the X node, X node is 22.</p>



<p class="wp-block-paragraph">It had a right child of 27 that is not in the output pattern.</p>



<p class="wp-block-paragraph">So that&#8217;s something that&#8217;s unaccounted for.</p>



<p class="wp-block-paragraph">I&#8217;m going to place it over here.</p>



<p class="wp-block-paragraph">Okay, now we&#8217;re ready to attach the nodes in the output pattern.</p>



<p class="wp-block-paragraph">Let me just bring something to your attention real fast.</p>



<p class="wp-block-paragraph">Notice how the 42 node, which was an outstanding child of one of the output pattern nodes,</p>



<p class="wp-block-paragraph">it had a child of its own, right?</p>



<p class="wp-block-paragraph">on the bottom here, you know, below the output pattern, if they had any children of their</p>



<p class="wp-block-paragraph">own, we would not like change their topology. We would not assign them to different parents.</p>



<p class="wp-block-paragraph">They would just stay exactly where they are, which means just for the purposes of this diagram,</p>



<p class="wp-block-paragraph">I should probably also bring the 55 down as the right child of the 42. So I can remember,</p>



<p class="wp-block-paragraph">you know, that it was there and not totally forget it and ruin the tree.</p>



<p class="wp-block-paragraph">27 had no children, so it&#8217;s fine. The 27 should be a left child of 34 because it&#8217;s greater than</p>



<p class="wp-block-paragraph">of 34 because it&#8217;s greater than 22 and it&#8217;s less than 34 so I&#8217;m going to stick it right there and</p>



<p class="wp-block-paragraph">then where would the 42 go well it would it would be a right child of 34 because it&#8217;s greater than</p>



<p class="wp-block-paragraph">34 so maybe I should make the 27 like just a little bit more to the left okay then I&#8217;m going</p>



<p class="wp-block-paragraph">to reconnect so the 34&#8217;s left child is 27 its right child is 42 and then you know this is easy</p>



<p class="wp-block-paragraph">like I make mistakes all the time too so I just want to double check that this is a valid binary</p>



<p class="wp-block-paragraph">search tree because I could have you know done the numbers incorrectly so we have 15 22 27 34 42 55</p>



<p class="wp-block-paragraph">it all increases it is a binary tree so it&#8217;s also a binary search tree and then it&#8217;s like</p>



<p class="wp-block-paragraph">it satisfies all the other properties so now how many nodes did I actually remove four five six and</p>



<p class="wp-block-paragraph">there were only six nodes in the entire tree before we did this rotation you know z is kind of the</p>



<p class="wp-block-paragraph">know z is kind of the culprit of why this happened so that means the rotated pattern is actually the</p>



<p class="wp-block-paragraph">final binary search tree so i&#8217;m just going to erase the whole entire tree and put the rotated</p>



<p class="wp-block-paragraph">pattern in the middle here then we just have to recompute all the balance factors to make sure</p>



<p class="wp-block-paragraph">that we&#8217;re done or that we&#8217;re not done so the leaves get zero and then the 42 gets a one and</p>



<p class="wp-block-paragraph">then the 34 gets a one because it&#8217;s got a height of one on its left subtree and a height of two on</p>



<p class="wp-block-paragraph">and a height of 2 on its right subtree, take the absolute value.</p>



<p class="wp-block-paragraph">The 22 node, I don&#8217;t think that&#8217;s quite finished yet.</p>



<p class="wp-block-paragraph">It&#8217;s got a balance factor of 2 because it&#8217;s here.</p>



<p class="wp-block-paragraph">Let&#8217;s just clarify to make sure everybody&#8217;s on the same page.</p>



<p class="wp-block-paragraph">Anytime I feel that I had to think even a little bit,</p>



<p class="wp-block-paragraph">I&#8217;ll sometimes just kind of take a little step back and make sure everybody&#8217;s okay.</p>



<p class="wp-block-paragraph">So the left subtree has a height of 1.</p>



<p class="wp-block-paragraph">You can see that I highlighted the left subtree.</p>



<p class="wp-block-paragraph">The right subtree has a height of 1, 2, 3.</p>



<p class="wp-block-paragraph">So 1 minus 3, take the absolute value.</p>



<p class="wp-block-paragraph">That&#8217;s going to be 2.</p>



<p class="wp-block-paragraph">value that&#8217;s going to be two so the balance factor of the 22 node is two meaning we&#8217;re not done</p>



<p class="wp-block-paragraph">rotating our tree it could be a little bit better a little bit faster so maybe i&#8217;m going to move this</p>



<p class="wp-block-paragraph">whole thing over to the left a little bit and then we&#8217;ll call the 22 node the z node because it&#8217;s the</p>



<p class="wp-block-paragraph">first node that&#8217;s out of whack then we have some more interesting choices right remember before</p>



<p class="wp-block-paragraph">if we&#8217;re going to go down into the left or down into the right it always seemed obvious but now</p>



<p class="wp-block-paragraph">seemed obvious but now to find our y we could go left or right but we have to go to the right</p>



<p class="wp-block-paragraph">because 34 has the taller subtree 15 it&#8217;s it&#8217;s a tree of just one it&#8217;s a height of one and 34 it&#8217;s</p>



<p class="wp-block-paragraph">a tree of height three so we go to the right to find y to find x again we need to look at a child</p>



<p class="wp-block-paragraph">of y with the tallest subtree so that&#8217;s not going to be 27 that&#8217;s a height of one it&#8217;s going to be</p>



<p class="wp-block-paragraph">42 with the height of two so the x node is this over here and now we&#8217;re ready to talk about</p>



<p class="wp-block-paragraph">ready to talk about what is XYZ and ABC. So X is, I always forget to change the color before I type</p>



<p class="wp-block-paragraph">this. Okay. X is 42. Y is 34. Z is 22. And then we get A and B and C. Okay, so A is the least value,</p>



<p class="wp-block-paragraph">the one that would belong on the left. I mean, you can just look visually on the diagram again.</p>



<p class="wp-block-paragraph">on the left right so that would have to be a because anything that starts leftmost should end</p>



<p class="wp-block-paragraph">up left leftmost in terms of a well-drawn diagram so b is going to be in the middle that&#8217;s the 34</p>



<p class="wp-block-paragraph">and then c is going to be the greatest value which is 42 again c 42 is the rightmost value both</p>



<p class="wp-block-paragraph">before and after we decided what is a xyz and abc so we&#8217;ve got that i&#8217;m going to go ahead and start</p>



<p class="wp-block-paragraph">for another new diagram.</p>



<p class="wp-block-paragraph">We&#8217;re going to say,</p>



<p class="wp-block-paragraph">we got that.</p>



<p class="wp-block-paragraph">Give it a little copy.</p>



<p class="wp-block-paragraph">Give it another little copy.</p>



<p class="wp-block-paragraph">Give it a copy.</p>



<p class="wp-block-paragraph">Then I&#8217;m going to draw my connections.</p>



<p class="wp-block-paragraph">Dang, how long is this video?</p>



<p class="wp-block-paragraph">Man, I knew this was going to be a gnarly example.</p>



<p class="wp-block-paragraph">That&#8217;s why I like doing it.</p>



<p class="wp-block-paragraph">Okay.</p>



<p class="wp-block-paragraph">Fix the numbers real fast.</p>



<p class="wp-block-paragraph">So the 27 is A, it&#8217;s 22.</p>



<p class="wp-block-paragraph">And then this is going to be B, which is 34.</p>



<p class="wp-block-paragraph">And then 27, or the rightmost node, is going to be the 42.</p>



<p class="wp-block-paragraph">Then we start looking at children that might be unaccounted for in our target pattern.</p>



<p class="wp-block-paragraph">So I&#8217;m going to duplicate this.</p>



<p class="wp-block-paragraph">And we&#8217;ll say, start by looking at Z.</p>



<p class="wp-block-paragraph">It had a left child of 15, which is unaccounted for in the output pattern.</p>



<p class="wp-block-paragraph">So I&#8217;m going to move 15 over here somewhere.</p>



<p class="wp-block-paragraph">And then we look at the 34.</p>



<p class="wp-block-paragraph">That&#8217;s already accounted for in the output pattern.</p>



<p class="wp-block-paragraph">So we&#8217;re done looking at Z&#8217;s children.</p>



<p class="wp-block-paragraph">So I&#8217;m just going to do this.</p>



<p class="wp-block-paragraph">Now we&#8217;re ready to look at Y.</p>



<p class="wp-block-paragraph">Y had a left child of 27.</p>



<p class="wp-block-paragraph">That&#8217;s actually unaccounted for.</p>



<p class="wp-block-paragraph">So I&#8217;m going to move the 20.</p>



<p class="wp-block-paragraph">I&#8217;m going to copy the 27 over here.</p>



<p class="wp-block-paragraph">And then we look at the 42.</p>



<p class="wp-block-paragraph">The 42 is already handled in the output pattern.</p>



<p class="wp-block-paragraph">So we don&#8217;t have to worry about it.</p>



<p class="wp-block-paragraph">worry about it okay now we&#8217;re ready to look at the x nodes children so we look at x it had a right</p>



<p class="wp-block-paragraph">child of 55 that&#8217;s also that&#8217;s also not accounted for in the output pattern so i&#8217;m going to make a</p>



<p class="wp-block-paragraph">copy so we have like three nodes to worry about and then you know just for diagram purposes in</p>



<p class="wp-block-paragraph">the code this would be easy to do but for the diagram we have to make sure are we dragging any</p>



<p class="wp-block-paragraph">of these unaccounted for children away from their other children that they might have so 55 it has</p>



<p class="wp-block-paragraph">children 27 it has no children 15 also has no children so these are pretty easy so just visually</p>



<p class="wp-block-paragraph">I&#8217;m going to rearrange I lost my camera what happened test test test whoa I&#8217;m tripping so I</p>



<p class="wp-block-paragraph">had a technical issue with my camera I had to edit out I guess a little portion where I was super</p>



<p class="wp-block-paragraph">confused and screaming and now I think we&#8217;re okay so we can continue the video so we&#8217;ve just looked</p>



<p class="wp-block-paragraph">children that are unaccounted for and accounted for them that&#8217;s so nice of us</p>



<p class="wp-block-paragraph">and we&#8217;re going to have to place them somewhere so this 15 again it can&#8217;t go</p>



<p class="wp-block-paragraph">anywhere over here on the right side that would be an invalid binary search</p>



<p class="wp-block-paragraph">tree it&#8217;s actually got to go on the left of the 22</p>



<p class="wp-block-paragraph">it&#8217;s the only place it could possibly go same thing for the 55 where is that</p>



<p class="wp-block-paragraph">going to go I don&#8217;t know maybe like all the way to the right because that&#8217;s the</p>



<p class="wp-block-paragraph">only numerically valid you know place that it could go to have a valid binary</p>



<p class="wp-block-paragraph">27 can&#8217;t go on the right of 34 it&#8217;s too small it ends up going on the right of 22.</p>



<p class="wp-block-paragraph">So now we&#8217;ve placed the children to account for them and I&#8217;m going to just like draw my</p>



<p class="wp-block-paragraph">connecting lines real fast and then how many nodes do we have here let&#8217;s see the 22</p>



<p class="wp-block-paragraph">1 2 3 4 5 6 1 2 3 4 5 6 oh actually that&#8217;s every single node in the tree just like last time we</p>



<p class="wp-block-paragraph">again guess that that would have happened because it might be likely to happen because the z node</p>



<p class="wp-block-paragraph">here was actually the root node of the tree. So I&#8217;m just going to you know replace the entire tree</p>



<p class="wp-block-paragraph">and say that we&#8217;re done rotating now. So we&#8217;ll just do this put this in the middle and then</p>



<p class="wp-block-paragraph">recompute all the balance factors just to check to see if we&#8217;re done. You can probably tell already</p>



<p class="wp-block-paragraph">this is a pretty decent tree so we might not have to rotate but I&#8217;m going to go ahead and</p>



<p class="wp-block-paragraph">have to rotate but I&#8217;m going to go ahead and just double check anyway. So the leaves get zeros</p>



<p class="wp-block-paragraph">and the 22 gets a zero because it&#8217;s got left and right subtrees of equal height. The 42 has a one</p>



<p class="wp-block-paragraph">and the 34 also has a zero because it&#8217;s left and right subtrees are equal height. This is maybe</p>



<p class="wp-block-paragraph">another good opportunity for me to point out that it&#8217;s not about weight or mass on the left versus</p>



<p class="wp-block-paragraph">right subtrees. It&#8217;s just about height only. So even though there are less nodes in the right</p>



<p class="wp-block-paragraph">The fact remains that the heights are the same. So actually that&#8217;s a zero for the root node</p>



<p class="wp-block-paragraph">This is now finally a valid AVL tree. We have rotated it enough. It is now considered</p>



<p class="wp-block-paragraph">Log time again, it&#8217;s going to be fast to search and insert and remove and all that stuff. So this is pretty great</p>



<p class="wp-block-paragraph">We are now officially done with this example tree. So thank you so much for watching this video</p>



<p class="wp-block-paragraph">I hope you learned a little bit of fun and had a little bit of stuff</p>



<p class="wp-block-paragraph">and I hope you enjoyed doing this tree with me it&#8217;s always a little stressful because it&#8217;s like</p>



<p class="wp-block-paragraph">a half hour tree and I always wonder like did I make a mistake five hours ago I don&#8217;t even know</p>



<p class="wp-block-paragraph">so I guess I&#8217;ll see you in the next video thanks for hanging in there with me</p>



<p class="wp-block-paragraph">hey everybody thanks for watching this video again from the bottom of my heart I really</p>



<p class="wp-block-paragraph">appreciate it I do hope you did learn something and have some fun if you could do me a please</p>



<p class="wp-block-paragraph">Could you please subscribe and follow this channel or these videos or whatever it is you do on the current social media?</p>



<p class="wp-block-paragraph">It&#8217;s a website that you&#8217;re looking at right now</p>



<p class="wp-block-paragraph">It would really mean the world to me and it&#8217;ll help make more videos and grow this community</p>



<p class="wp-block-paragraph">So we&#8217;ll be able to do more videos longer videos better videos or just I&#8217;ll be able to keep making videos in general</p>



<p class="wp-block-paragraph">So please do do me a kindness and and subscribe</p>



<p class="wp-block-paragraph">You know sometimes I&#8217;m sleeping in the middle of the night and I just wake up because I know somebody subscribed or followed</p>



<p class="wp-block-paragraph">subscribed or followed. It just wakes me up and I get filled with joy. That&#8217;s exactly what happens</p>



<p class="wp-block-paragraph">every single time. So you could do it as a nice favor to me or you could you could troll me if</p>



<p class="wp-block-paragraph">you want to just wake me up in the middle of the night. Just subscribe and then I&#8217;ll just wake up.</p>



<p class="wp-block-paragraph">I promise that&#8217;s what will happen. Also if you look at the middle of the screen right now you</p>



<p class="wp-block-paragraph">should see a QR code which you can scan in order to go to the website which I think is also named</p>



<p class="wp-block-paragraph">somewhere at the bottom of this video and it&#8217;ll take you to my main website where you can just</p>



<p class="wp-block-paragraph">all the videos I published and the services and tutorials and things that I offer and all that</p>



<p class="wp-block-paragraph">good stuff. And, uh, if you have a suggestion for, uh, uh, clarifications or errata or just future</p>



<p class="wp-block-paragraph">videos that you want to see, please leave a comment. Or if you just want to say, Hey, what&#8217;s</p>



<p class="wp-block-paragraph">up, what&#8217;s going on? You know, just send me a comment, whatever. I also wake up for those in</p>



<p class="wp-block-paragraph">the middle of the night. I get, I wake up in a cold sweat and I&#8217;m like, it would really,</p>



<p class="wp-block-paragraph">really appreciate it. So again, thank you so much for watching this video and enjoy the cool music</p>



<p class="wp-block-paragraph">as I fade into the darkness, which is coming for us all.</p>



<p class="wp-block-paragraph">Thank you.</p>



<p class="wp-block-paragraph">so</p>



<p class="wp-block-paragraph">Hey there! Let&#8217;s rotate an AVL tree…</p>



<p class="wp-block-paragraph">Hmm…</p>



<p class="wp-block-paragraph">Test test test! Whoa, I&#8217;m trippin&#8217;!</p>
<p>The post <a href="https://www.NeuralLantern.com/avl-tree-rotations-practice-balancing-a-huge-linear-tree-step-by-step/">AVL Tree Rotations Practice: Balancing a Huge Linear Tree Step by Step</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/avl-tree-rotations-practice-balancing-a-huge-linear-tree-step-by-step/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
