 So let's take for example creating a traditional normal binary search tree with the insertions as listed. So, since I say insert four first, it gets inserted first. It's the root, three becomes the left child, two becomes its left child, one becomes its left child. Now, you might notice nothing's going on over here on the right side and that's actually a major issue with a traditional binary search tree. What happens if I had started from a hundred and worked my way down? Well, this would just continue trailing outward. So, one of the worst case scenarios in a traditional binary search tree is that it might have a height of n. However, many nodes, n nodes that I have will be the height of my tree. So, what can we do? Well, we can take this idea of a binary search tree, two children, and work off of some different implementations. One of those is known as an AVL tree. And the entire premise is that it is self-balancing. So, how does it do this? It does it through something we like to call a balance factor. What we do is we look at the difference in height between the right and left nodes of any given node, the right and left children of any given node, and if we find them, and we hope that they are within a plus or minus of one. If they're not, we would classify that as being imbalanced. So, say for example, I made another style, we come in here and I have that same four at two. So, in this tree, we would classify the heights as being, well, my leaf node. My leaf node can go no further, so it's a zero. My four node has no children, so I can't go any further, it's also a zero. And if I look at my root node, my three, it can go one node to the left or it can go one node to the right. So, it has a height of one. Now, so far, this has not done anything outlandish. We can call this a proper binary search tree and we can also call it balanced. The reason why is, again, if we look at that balance, we look at any given nodes, right child, height, so right, I guess, dot height, and we subtract that by that node's left child's height, height. In our case up here, we see zero and zero, zero minus zero, and we get ourselves a, what we would call a balanced, so equaling zero, we would call this a balanced node. But what happens if I were to insert in a single node? Let's say, for example, I came in and added that insert one. Well, every node that I had to go through to get to the one, again, if we're thinking about this in a binary search tree, I had to touch the three, touch the two to get to the one. I need to make their changes. Now, the height of one, since it's a leaf node, is a zero. The height of two just went up, so it's no longer zero. It's now one, and the height of three just went up because we look for the maximum depth it can go. I can either go one node here, or I can go one, two nodes over here. So, if we looked at that same kind of premise on our three node for a second, we could say, well, what's the right height? Well, we just changed it, it's now one, and what's my left height? Sorry, my right height is still zero. My left height is now one. Well, if we calculated this out, we get a negative one. This is not balanced, but it's still okay, because obviously, we need to have a slight, you know, plus or minus one for the balance factor. And so, what we would call this is left heavy, heavy. So, what happens if I were to come in and I added, say, two nodes to the four slot? So, I came in, I gave a five, and then I gave a six. Well, both times, as I were updating those, six has a zero height, five has a one height, four can go one, two times, so it now has a height of two, and three, since it can either go one, two, or one, two, three, gets a height of three. So, the same kind of factors are coming into play. If I looked at the balance factor of my three node, I take the height of my right child. The height of my right child now is two, subtracted by the height of my left child, which is still one, and in this case, we get a positive one. Now, same kind of thing that we saw. It's not balanced, it's not left heavy, it's right heavy.