00:01
So they want us to show that for the tournament sort, we're going to have big o of n -login comparisons.
00:09
So from number 16, we already know to find our largest element, we're going to have n minus 1 or 2 to the k minus 1 comparisons if in the number of elements for sorting is 2 to the k.
00:24
And then we found for each smaller element after this for our comparison sort, it's just going to be k minus 1 sort.
00:30
Up to the n minus 1 largest element.
00:38
And then we don't need to sort that last element because all the other ones are sorted, we just assume it's the last one.
00:44
So let's see if we can actually show that this will be that.
00:48
Well, from that first part, we know it's just going to be n minus 1.
00:54
And then, after this, we would need to have, so let's see, it was going to be k minus 1 plus, k minus 1 plus dot dot all the way up to k minus 1 and we need to do this well let's see we would start with this being our second third and all the way up to n minus 1 so we could actually rewrite this as the sum being so sum from i is equal to 2 just to n minus 1 like that of k minus 1 and now since k minus 1 does it depend on what we have for i that means this is just going to be n minus 1 plus k minus 1 times so we would do n minus 1 and then we subtract off that bottom 1 and then we add 1 to that so those ones cancel out.
02:18
I'm just going to have n minus 2 there.
02:19
So we have n minus 1 plus k minus 1 and minus 2.
02:26
Now we can go ahead and expand that over there...