In previous lecture, we have just learned about a single input the N for calculating the N, for calculating
our inputs complexity.
However, sometimes we will deal with more than just one input.
So please, let's actually create a new function named integer that will return an integer integer sum
of division, which is going to get like five parameters for first is integer M here m array integer
n.
And, uh, integer M array again.
And integer M.
Here.
Integer Z array.
And the integer M.
So here.
This year here, we're going to write our code inside this and total is going to be zero.
So we're going to create a for loop now for for integer equals zero while the E is less than n, then
iterate our loop still.
So.
Now let's fill our four.
So we're also going to do the nested four statement here.
We will do another four statement inside it for Integer here.
And G, while the G is less than M, then increment G by one plus plus G here.
So.
And now we will make the total of it.
So we will use this total and put it here.
The total plus equals then.
The first is going to be.
M array.
R e here, which we will get this from here.
And multiply by multiply by x ray x, r or z x ray g.
And that's it.
After that, the executing our function, we will return the total of our function here.
So now that there is a very amortized so this is a amortized analysis comes in so amortized analysis
calculates the complexity of performing operation for varying inputs, for instance, when we insert
some elements into several arrays.
So now the complexity doesn't only depend on the end input only, but it also depends that the input
here.
So the complexity here, as we did in previous lectures, we calculated the complexity of these operations
and here we're going to calculate the complexity now.
So the time, complexity, time, oops, actually let's make three here.
Time complexity is going to be n m, which is going to be n multiply by M.
So we are going to learn about these analysis methods in more detail in next lecture.
But we are done with our lectures and in the section of our yet.
So this in this lecture, in this section, we provided us with an introduction to basic Cplusplus.
We created a simple program full of control and all data types that we learned in this lecture.
So next we are going to create our first data structures that is linked list, and we are going to perform
some operations to use on that data structure.