00:01
Okay, so here we're describing an algorithm that'll find our repeating integers in a list, right? so let's just go ahead and call this procedure repeated, something that explains what it does, and this procedure will take in a list of integers, so up to some n number of integers.
00:25
I'm just going to shorten integers to ints here.
00:30
And of course, this will only work if there's at least one element in the list, right? so we need n to be greater than or equal to 1.
00:39
And so this w slash just means width.
00:43
Additionally, it is a non -decreasing list.
00:47
So a 1 must be less than or equal to a 2, which must be less than or equal to a 3, which must be less than equal to a 4 and so on.
01:01
So these are the stipulations we have.
01:03
Once we are creating a list of these numbers, we're going to initialize an empty set that we can add to.
01:14
Additionally, we're going to create an n -plus -1 element to our list, right? so we'll set a -n plus 1 equal to a -n, this last element in the list, but we're going to subtract one from it.
01:31
So it's less than that.
01:32
So you don't be confused.
01:34
Here, n plus one is a subscript.
01:38
But then the a -n, just the n is the subscript, and we're subtracting it.
01:42
And so by creating this last element, we do that due to the comparisons we're going to make.
01:50
So while investigating any element, we're going to compare it to both the previous and next element in the list...