1 00:00:00,000 --> 00:00:05,000 All right, before we actually write a code that carries out this procedure, let's do an example. 2 00:00:05,000 --> 00:00:09,000 Here's a lovely heap. In fact, well, I just covered this up. 3 00:00:09,000 --> 00:00:15,000 It's a lovely heap where each of the nodes is smaller or no larger than any of its children, 4 00:00:15,000 --> 00:00:18,000 except for this pesky 50 at the root. 5 00:00:18,000 --> 00:00:23,000 Using what I described in the previous slide what we're just talking about, 6 00:00:23,000 --> 00:00:27,000 you can actually patch this up by moving the 50 around doing some various swaps. 7 00:00:27,000 --> 00:00:29,000 In fact, you have do do a series of swaps. 8 00:00:29,000 --> 00:00:35,000 And when the swapping is all done, which node in the tree, according to the red numbering, 9 00:00:35,000 --> 00:00:40,000 which node is going to be the resting place of 50 once the heap property is established? 10 00:00:40,000 --> 00:00:46,000 Just write the node number where 50 ends up in the box.