00:01
We're going to go ahead and call this algorithm ls for linear search.
00:05
And the input is going to be a list of integers.
00:09
That'll be a1 to a .n that are increasing.
00:15
I'm just going to abbreviate integers as ints.
00:19
And we also need the element that we are adding to this list, right? and so in this case, that will be another integer, and we'll call it x.
00:29
So first we want to define a value, we'll call it i.
00:36
Okay, and that's going to be the position of the element that we're comparing with x.
00:41
We're going to start it at 1.
00:45
And so while, because we want this thing to terminate once we've exhausted the whole list, so while i is less than or equal to n, right, and x is greater than a .i...