 So, since our tree is a data type, it has a lot of the same structure and same implementations that we've seen in pretty much everything, stacks, lists, arrays, and there is a thing we would call our lookup. Now, for my sake, I'm going to say that, let's say, I arbitrarily want to do a lookup on 13. So, I've built out this wonderful, wonderful tree, and I start to do a lookup. Well, once again, I start at my root, because that root is going to be able to tell me whether or not I need to kind of where to go. We can see I'm over here, but how we get there sort of depends. So this right here, I like to consider it a key. We've started to introduce this idea of keys when we were looking into dictionaries. This could be anything. In my last video, I was using letters. In this video, I'm using numbers. It could be anything I want, because all I really care about is I need to do a comparison. I need to do a comparison, in this case, of 13 to 50. Now, actually, we'll even kind of stop there. So when I do a lookup, let's say I do a lookup on k. The first thing I need to do is, given some node, so I'm starting at my 50, does k equal 50? Well, if it does, I just happen to find the element I was looking for, and I can return. Otherwise, I need to make two decisions. Is k less than 50, and is k greater than 50? I can put these in really any order I'd like. I'd probably put this one first, because as you can imagine, that's important. So in this case, if this happens, I get to return, because I'm done. Now this is the interesting thing. Since I'm asking if k is less than 50. If k is less than 50, I'm going to go down to my left child. If k happens to be greater than 50, I go down to my right child. One of the things about a binary search tree is everything is in order. So whatever I look up. So going back to this being instead of k, if I said it was 13, is 13 greater than 50? No. Is 13 less than 50? Well, yes it is. So I come down, and I actually repeat the same process. Is 13 equal to 15? If it was, we return. It's not. Is 13 less than 15? Well, yes it is. And in that case, we go down. We ask the same questions. Is 13 equal to 10? No. Is 13 less than 10? No. So finally we ask the last one. Is 13 greater than 10? Well, yes it is. And as you can imagine, we go down. Since I happen to have found 13, well, 13 does in fact equal 13. Return it. But that's actually a good kind of point. What would happen if I had done 14? So all right, we do a look up on 14. So the first three kind of questions still exist. But they're actually not going to be in that order. First one I still do is if, say, my 14 equals 50. Again that's telling me return my 14, return my 50. We know that's wrong. But it's that else that we care about. First thing I need to do before I determine left and right is I actually have to find out if 50 has kids. I don't have enough room for children, but has children. The reason why is because if I'm at a leaf node, say for example I'm at this 13 we're going to get to, I can't move any further. So in our traversal we see that 14 is less than 50, so we go down, 14 is less than 15, so we go down. 14 is greater than 13, or greater than 10. But this is where we ask that same kind of question. Is 14 equal to 13? Well no. So I did my if statement, no, else. If 13 has zero children, I don't know, I would return something like maybe negative 1, or throw an exception. My 14 is not in my list.