00:02
Okay, so in this function we're going to, in this question we're looking at this function and we want to know what will be the output.
00:11
So on the right, i'm going to keep track of the value of n that we have.
00:20
And this function here, it calls itself.
00:23
So it gets confusing.
00:24
So we'll need to make sure that we come back when we stop, when we are at the original call to, of this function.
00:35
So the original input is 45.
00:38
So i will write 45 like this.
00:42
And then i'm going to have kind of a grid.
00:49
It's a bit too wide actually.
00:52
I'm going to keep a grid to make sure that i know in which calls of my function that i am.
01:03
I'm going to give myself as much space as possible and that hopefully everything can fit within this one board so here 45 is 45 greater than 100 no so i move like this for example and i'm gonna call this inner i'm at the inner function here 45 plus 11 is 56 506 greater than 100 no so i'm gonna move here, 67.
01:50
Again, i'm always in the inner loop, in the inner call of the function.
01:56
Then 67, that's 11, 78.
02:02
I'm going to continue until we get something greater than 100.
02:06
189, 100, which is not greater than 100, and then 100.
02:12
So once we reach 111, we start going back up in our functions.
02:28
So to show that in my amazing system to keep track of the function call, i'm going to use a different color.
02:40
So blue is going to be for the inner function call.
02:43
And red is going to be for the outer function call...