WEBVTT

00:00.600 --> 00:09.360
In previous lecture, we have just learned about a single input the N for calculating the N, for calculating

00:09.360 --> 00:10.960
our inputs complexity.

00:10.980 --> 00:13.740
However, sometimes we will deal with more than just one input.

00:13.740 --> 00:20.820
So please, let's actually create a new function named integer that will return an integer integer sum

00:20.820 --> 00:33.150
of division, which is going to get like five parameters for first is integer M here m array integer

00:33.150 --> 00:33.810
n.

00:34.890 --> 00:38.790
And, uh, integer M array again.

00:41.730 --> 00:43.080
And integer M.

00:47.840 --> 00:48.680
Here.

00:48.830 --> 00:50.570
Integer Z array.

00:52.930 --> 00:54.010
And the integer M.

00:54.220 --> 00:55.780
So here.

00:56.590 --> 01:04.510
This year here, we're going to write our code inside this and total is going to be zero.

01:05.210 --> 01:15.830
So we're going to create a for loop now for for integer equals zero while the E is less than n, then

01:15.860 --> 01:19.100
iterate our loop still.

01:19.670 --> 01:20.690
So.

01:22.140 --> 01:23.850
Now let's fill our four.

01:23.850 --> 01:27.300
So we're also going to do the nested four statement here.

01:27.300 --> 01:32.880
We will do another four statement inside it for Integer here.

01:33.720 --> 01:42.870
And G, while the G is less than M, then increment G by one plus plus G here.

01:43.230 --> 01:43.830
So.

01:43.830 --> 01:46.050
And now we will make the total of it.

01:46.050 --> 01:49.530
So we will use this total and put it here.

01:49.890 --> 01:53.010
The total plus equals then.

01:54.060 --> 01:55.170
The first is going to be.

01:55.170 --> 01:56.460
M array.

01:56.490 --> 01:57.600
M array.

01:57.950 --> 02:04.110
R e here, which we will get this from here.

02:05.980 --> 02:16.000
And multiply by multiply by x ray x, r or z x ray g.

02:17.110 --> 02:18.150
And that's it.

02:18.160 --> 02:25.600
After that, the executing our function, we will return the total of our function here.

02:25.600 --> 02:33.010
So now that there is a very amortized so this is a amortized analysis comes in so amortized analysis

02:33.010 --> 02:39.130
calculates the complexity of performing operation for varying inputs, for instance, when we insert

02:39.130 --> 02:40.870
some elements into several arrays.

02:40.870 --> 02:47.830
So now the complexity doesn't only depend on the end input only, but it also depends that the input

02:47.830 --> 02:48.310
here.

02:48.310 --> 02:55.570
So the complexity here, as we did in previous lectures, we calculated the complexity of these operations

02:55.570 --> 02:58.600
and here we're going to calculate the complexity now.

02:59.110 --> 03:03.900
So the time, complexity, time, oops, actually let's make three here.

03:03.910 --> 03:13.100
Time complexity is going to be n m, which is going to be n multiply by M.

03:14.270 --> 03:20.300
So we are going to learn about these analysis methods in more detail in next lecture.

03:20.300 --> 03:24.670
But we are done with our lectures and in the section of our yet.

03:24.680 --> 03:31.880
So this in this lecture, in this section, we provided us with an introduction to basic Cplusplus.

03:31.880 --> 03:36.980
We created a simple program full of control and all data types that we learned in this lecture.

03:36.980 --> 03:43.130
So next we are going to create our first data structures that is linked list, and we are going to perform

03:43.130 --> 03:46.550
some operations to use on that data structure.
