00:01
So they want us to use the tournament sorting algorithm to order this set of numbers here.
00:10
And so let's just kind of go through that process that they said.
00:15
So what we're going to do is we're going to just order them like this, and then we're going to compare.
00:21
So they kind of do the first couple of these.
00:23
But let's just go ahead and do it step by step.
00:26
So we're going to first compare 22 and 8.
00:29
So 22 is larger.
00:31
Then we're going to compare 14 and 17.
00:34
17 is larger.
00:36
We compared 3 and 9.
00:37
9 is larger.
00:39
Then we compare 27 and 11, so 27 is larger.
00:41
So the tournament was just asking, well, which one of these is larger? so you could also do it where it's the smallest one, but at least with the algorithm they're talking about.
00:52
They chose the largest to move on to the next round.
00:56
All right.
00:57
So now we're going to repeat this again.
00:58
But now we're going to do it with this second round.
01:00
So we're going to compare 22 and 17.
01:04
So between these, 22 is larger.
01:07
Then we're going to compare 9 and 27 and 27 is larger.
01:12
And then for our final round, we're going to compare 22 and 27 and 27 is larger.
01:19
So what we learned from this is that 27 is our largest value.
01:24
So we can come over here and put 27.
01:29
All right.
01:29
And then what they did after this was, remove all of the 27s and replace it with a negative infinity so i'm going to go ahead and copy this real quick and now that we have this recopied so let's just erase all the 27s and now down here at the very bottom where 27 was like i was saying we're going to put negative infinity all right so now we're going to repeat the same thing again so notice how over here on the left side we really don't need to do any comparisons but if we're coming up with an algorithm for this, then you would want to start comparing at the bottom again for all of these.
02:14
But we're just going to do negative infinity and 11.
02:16
So negative infinity, we assume, is going to be smaller than every other value.
02:19
So that means 11 wins this one.
02:22
Now it's going to be 9 versus 11, while 11's larger.
02:27
Then it's going to be 22 versus 11, well, 22 is larger.
02:32
So that tells us that 22 is the largest.
02:34
So before we had 27, now we have 22.
02:40
All right, so now i'm going to go ahead and copy this again really quickly.
02:46
And so now, just like we did before, with replacing 27 with negative infinity, we're going to replace 22 with negative infinity.
02:56
So let's erase all of our 22s.
02:59
And then everywhere there is a 22.
03:02
We're going to put negative infinity.
03:04
So let's just go ahead and start here.
03:06
So only the left side we're going to have to really do anything with.
03:10
So negative infinity verse 8, well, 8's larger.
03:12
So that moves up 8 versus 17 well 17 is larger so that moves up and then 17 versus 11 well 17 is larger so that moves up so before we had 27 22 and then we have 17 now we're going to copy this again and then replace all the 17s with negative infinity now like i was saying we're going to replace all these 17s so let's just start by putting negative infinity out here so negative infinity verse 14 that's going to be 14 and then 8 versus 14 well that's 14 and then 14 versus 11 that's 14 also so we had 27 22 17 and now our largest is 14 now we're going to copy this again and then we're going to replace 14 with negative infinity so we get rid of this 14 now since that was the winner of the last one we're going to replace that with another negative infinity.
04:32
All right.
04:33
So negative infinity versus negative infinity...