00:02
Hello, so there are two main search art items that we're going to talk about.
00:05
The sequential search that simply looks at the number one by one until it finds the value is looking for.
00:13
And the binary search, which starts by looking at a value in the middle, and comparing it to see whether the number is searching is before or after, and then goes on like that, comparing with values in the middle, until it finds the right number.
00:27
On average, binary search is faster, but now we're going to look at an example of this particular list and which algorithm finds different numbers first.
00:38
So first, which algorithms finds number 137 more quickly? so for sequential, it would be really easy, it will look at the first one, the second, third one, and so on, and it will take it six comparisons to get it, so sequential, it will be six.
00:57
For binary, it will look at the number in the middle.
01:01
In this case, that will be 96.
01:04
And it would know that the number is bigger, so it would then look at the number in the middle of this.
01:11
That would be 374.
01:13
And that would be the second comparison.
01:17
Then it will see that 137 is smaller, so it will look at the number in the middle of years here...