So, in the previous video, you learned about an UpTree, and we talked about how you'd implement the UpTree, and we talked about kind of the worst case running time. Let's actually dive a little bit deeper into the analysis and find out some more. So to do that, I provided a code for us to actually look at the find algorithm. Let's look at that. The find algorithm is simply going to say, if the root node of the tree is less than 0, so if it's negative 1, we know we found the identity element. Otherwise, we need to recursively call the find algorithm to look at the element that's denoted inside the array itself. So, that means if we have an UpTree that has four at the root, then three underneath that, two underneath that, and one underneath that, the running time of this algorithm is going to be proportional to the height of our UpTree. Because, notice, if we find the one, finding one means we have to look at two. Looking at two require us to look at three. Looking at three is going to require us to look at four. So, the deepest node in the tree dominates the amount of time it's going to take us to look at the tree itself. So, we're going to say the running time of this UpTree is going to be O of H, and the worst case, H is going to be equal to N. So, all over data may be a single linked list. If our worst case O of N, then we've done no better than our naive implementation. What we hope is, we hope to build an UpTree that allows us to create a tree with an ideal structure. So think about what we'd love for an ideal structure to be. We know that every node may not be an identity node, so we can't have everything with a value of negative one. But what we could have, is we could have a single identity node as a root node, and every single child could be right underneath that root node. So let's look at what this might look like. So, if we have the element four as our identity element, our ideal UpTree has the element three, two, one, zero and anything else all pointing to four itself. So, notice that this tree is extremely flat. There's only a height of one in this entire tree. This is fantastic. Because that means, even if we find any node that's not a identity node, the worst it has to do is look up one node, find that value of that node is negative, and because that value is negative, we found that identity node. This is absolutely fantastic and ensures that we have a constant running time. So what we want to do is we want to build trees, that is as close as possible to the ideal tree, so we don't end up in this worst case O of N type situation. We're going to study a few different techniques that we can do, that when we actually do a union, we can be smart about the union. When we do a find, we can be smart about making sure that every other find after us runs a lot quicker. So we're going to look at how to use smart union and path compression in the next few videos. I'll see you there.