1 00:00:00,600 --> 00:00:09,360 In previous lecture, we have just learned about a single input the N for calculating the N, for calculating 2 00:00:09,360 --> 00:00:10,960 our inputs complexity. 3 00:00:10,980 --> 00:00:13,740 However, sometimes we will deal with more than just one input. 4 00:00:13,740 --> 00:00:20,820 So please, let's actually create a new function named integer that will return an integer integer sum 5 00:00:20,820 --> 00:00:33,150 of division, which is going to get like five parameters for first is integer M here m array integer 6 00:00:33,150 --> 00:00:33,810 n. 7 00:00:34,890 --> 00:00:38,790 And, uh, integer M array again. 8 00:00:41,730 --> 00:00:43,080 And integer M. 9 00:00:47,840 --> 00:00:48,680 Here. 10 00:00:48,830 --> 00:00:50,570 Integer Z array. 11 00:00:52,930 --> 00:00:54,010 And the integer M. 12 00:00:54,220 --> 00:00:55,780 So here. 13 00:00:56,590 --> 00:01:04,510 This year here, we're going to write our code inside this and total is going to be zero. 14 00:01:05,210 --> 00: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 15 00:01:15,860 --> 00:01:19,100 iterate our loop still. 16 00:01:19,670 --> 00:01:20,690 So. 17 00:01:22,140 --> 00:01:23,850 Now let's fill our four. 18 00:01:23,850 --> 00:01:27,300 So we're also going to do the nested four statement here. 19 00:01:27,300 --> 00:01:32,880 We will do another four statement inside it for Integer here. 20 00:01:33,720 --> 00:01:42,870 And G, while the G is less than M, then increment G by one plus plus G here. 21 00:01:43,230 --> 00:01:43,830 So. 22 00:01:43,830 --> 00:01:46,050 And now we will make the total of it. 23 00:01:46,050 --> 00:01:49,530 So we will use this total and put it here. 24 00:01:49,890 --> 00:01:53,010 The total plus equals then. 25 00:01:54,060 --> 00:01:55,170 The first is going to be. 26 00:01:55,170 --> 00:01:56,460 M array. 27 00:01:56,490 --> 00:01:57,600 M array. 28 00:01:57,950 --> 00:02:04,110 R e here, which we will get this from here. 29 00:02:05,980 --> 00:02:16,000 And multiply by multiply by x ray x, r or z x ray g. 30 00:02:17,110 --> 00:02:18,150 And that's it. 31 00:02:18,160 --> 00:02:25,600 After that, the executing our function, we will return the total of our function here. 32 00:02:25,600 --> 00:02:33,010 So now that there is a very amortized so this is a amortized analysis comes in so amortized analysis 33 00:02:33,010 --> 00:02:39,130 calculates the complexity of performing operation for varying inputs, for instance, when we insert 34 00:02:39,130 --> 00:02:40,870 some elements into several arrays. 35 00:02:40,870 --> 00:02:47,830 So now the complexity doesn't only depend on the end input only, but it also depends that the input 36 00:02:47,830 --> 00:02:48,310 here. 37 00:02:48,310 --> 00:02:55,570 So the complexity here, as we did in previous lectures, we calculated the complexity of these operations 38 00:02:55,570 --> 00:02:58,600 and here we're going to calculate the complexity now. 39 00:02:59,110 --> 00:03:03,900 So the time, complexity, time, oops, actually let's make three here. 40 00:03:03,910 --> 00:03:13,100 Time complexity is going to be n m, which is going to be n multiply by M. 41 00:03:14,270 --> 00:03:20,300 So we are going to learn about these analysis methods in more detail in next lecture. 42 00:03:20,300 --> 00:03:24,670 But we are done with our lectures and in the section of our yet. 43 00:03:24,680 --> 00:03:31,880 So this in this lecture, in this section, we provided us with an introduction to basic Cplusplus. 44 00:03:31,880 --> 00:03:36,980 We created a simple program full of control and all data types that we learned in this lecture. 45 00:03:36,980 --> 00:03:43,130 So next we are going to create our first data structures that is linked list, and we are going to perform 46 00:03:43,130 --> 00:03:46,550 some operations to use on that data structure.