WEBVTT

00:01.120 --> 00:07.810
A list is a sequence of items with similar data types where the order of items positions matters.

00:07.810 --> 00:15.850
So there are several common operations that are available in a list of a d t here.

00:15.850 --> 00:20.170
So a the T here.

00:20.470 --> 00:30.910
So we have the get firstly here, the get, which will return the value of selected index in this case

00:30.940 --> 00:32.410
E here for example.

00:33.100 --> 00:42.940
And the if the index is out of bounds, it will simply return the Z minus one here.

00:44.280 --> 00:45.300
Yes.

01:49.400 --> 01:55.520
A list is a sequence of items with a similar data types with the order of items.

01:55.520 --> 01:57.500
Positions matters.

01:57.500 --> 02:01.550
So there are several common operations of the ADT here.

02:01.550 --> 02:03.380
So let's actually here.

02:03.380 --> 02:08.090
So there are several common operations that are available in the list.

02:09.490 --> 02:13.890
Ad t a t t.

02:13.930 --> 02:14.530
Here.

02:14.620 --> 02:15.610
The first is.

02:15.640 --> 02:17.080
And they are here.

02:17.080 --> 02:18.250
So they are.

02:18.280 --> 02:27.190
Let's talk about the get here the get, which will return the value of selected index here.

02:27.520 --> 02:35.290
If the index e is out of bounds, it will simply return minus one.

02:36.340 --> 02:38.050
We also have insert.

02:38.050 --> 02:47.890
So which this insert will insert the value v value at the position of index E here.

02:47.890 --> 02:50.800
So in this case it's our value.

02:52.380 --> 02:57.150
And it's our here is our position.

03:02.090 --> 03:04.240
They also have the search here.

03:04.270 --> 03:10.570
The search will return the index of first occurrence of V.

03:11.650 --> 03:19.420
If the value V does not exist, then it will return the minus one here.

03:20.410 --> 03:26.760
We also have the remote, so which will obviously remove the item in the index.

03:26.980 --> 03:36.460
Here, index E So for simplicity, we are going to build a list, a team that accepts integer data only

03:36.460 --> 03:38.380
from zero and higher.

03:38.560 --> 03:45.790
So now using the array datatype we learned earlier, let's build a new team named list which contains

03:45.790 --> 03:47.680
a preceding operations.

03:47.680 --> 03:55.390
So we need two variables to hold the list items each, which is going to be my items variable and the

03:55.390 --> 03:59.320
number of the items in the list, which is going to be my count here.

03:59.740 --> 04:03.550
So now actually, let's delete this.

04:09.000 --> 04:15.120
And actually, let's move this here and delete those drawings.

04:18.100 --> 04:18.940
Also this.

04:20.070 --> 04:20.690
Here.

04:21.180 --> 04:22.550
Now move it here.

04:22.560 --> 04:23.640
Right here.

04:23.640 --> 04:25.820
Let's keep an eye on him.

04:25.830 --> 04:27.030
And here.

04:27.060 --> 04:30.150
So now we're going to create a new list.

04:32.660 --> 04:42.110
So as I said, we need two variables to hold the list of item, which is going to be my items here.

04:43.660 --> 04:46.300
Mark my items.

04:46.330 --> 04:50.800
It's going to be the my items.

04:53.030 --> 04:58.460
Which is my items will hold the list of items.

04:58.460 --> 05:06.710
And we also need a number of items in the list in the my count here, my count.

05:08.570 --> 05:14.270
So we will have these are the this is our first we will define first and then we will define this later

05:14.270 --> 05:14.750
here.

05:15.830 --> 05:17.570
So our for operations.

05:17.570 --> 05:22.610
So actually we will make them we will make both the both of them.

05:22.610 --> 05:25.880
We will make both of them the private here.

05:25.880 --> 05:30.470
So this these are going to be the private.

05:34.420 --> 05:35.660
Uh, so.

05:37.450 --> 05:38.240
Uh, so.

05:38.250 --> 05:45.030
So we will make them private because it cannot be accessed from outside our class here.

05:45.030 --> 05:46.300
So we want to.

05:46.320 --> 05:51.360
We don't want to access this outside of class here.

05:54.220 --> 05:57.040
Uh, so we will also need.

05:59.770 --> 06:01.240
Uh, we will also implement.

06:02.120 --> 06:05.270
The four operations describe previously, we will implement it.

06:05.270 --> 06:14.480
So this these all of these four operations that we you learned earlier of this lecture, all of these

06:14.480 --> 06:15.710
four operations.

06:17.720 --> 06:20.660
Uh, so we and we are also going to do.

06:20.930 --> 06:28.130
In addition, we need a constructor, a destructor and a method to let us know the number of items that

06:28.130 --> 06:32.630
the List class has, which is named count here.

06:33.770 --> 06:40.760
So based on this requirement, uh, let's actually firstly create the list header file.

06:40.760 --> 06:44.510
So let's delete this here.

06:44.510 --> 06:45.470
Delete.

06:46.550 --> 06:48.590
Oops, we don't want to delete that.

06:48.800 --> 06:49.610
Yes.

06:49.700 --> 06:52.960
Here we will use this, uh, methods.

06:53.210 --> 06:54.320
We will look at them.

06:55.280 --> 06:57.360
Here and delete this.

06:57.380 --> 07:01.760
So now we're going to firstly create a list here and class file.

07:01.970 --> 07:03.290
So now.

07:05.160 --> 07:08.660
Uh, right click on the project class list here.

07:08.670 --> 07:12.960
This will automatically create the list header file and here.

07:14.310 --> 07:20.700
Uh, firstly, we if the untitled list arch here, uh, the light also this.

07:20.700 --> 07:23.610
And after that we're going to create the class list.

07:23.610 --> 07:25.670
As you can see, it's automatically created here.

07:25.680 --> 07:32.970
So as I said earlier, we will define private two variables, the which is my count and my items.

07:32.970 --> 07:35.370
So my, my.

07:37.230 --> 07:41.220
Or it's going to be integer integer my items.

07:41.610 --> 07:44.130
And this is going to be we also need the asterisk here.

07:44.130 --> 07:51.510
So my items and integer my count.

07:53.090 --> 07:54.590
And we will define public.

07:55.100 --> 07:57.680
So this this has to be private here.

07:58.370 --> 08:01.010
And we'll also define the public here.

08:01.370 --> 08:03.440
The public is going to be list constructor.

08:03.980 --> 08:08.990
So this constructor here also integer get.

08:09.260 --> 08:12.410
So this is our that we discussed earlier.

08:12.410 --> 08:15.110
This is firstly the get here.

08:15.920 --> 08:24.680
So actually let's uh, whenever we type this, let's actually so we made this get implemented, get

08:24.680 --> 08:36.140
here and now we will implement the create the class, the void, uh, the which is insert class integer

08:36.140 --> 08:40.490
index index and integer value, as I said.

08:40.580 --> 08:43.850
And actually we also need the parameter index here.

08:43.850 --> 08:50.360
So integer index and as you can see here, insert is again done.

08:50.360 --> 08:57.680
And we are also going to create the class integer search which will return integer.

08:57.680 --> 09:04.580
And we need just one parameter here, which is integer value that we value that the heading level one

09:04.790 --> 09:05.270
exiting.

09:05.270 --> 09:11.720
Narrator That's the value we want to search here and we will also create the remove and we will create

09:11.720 --> 09:12.740
the count here.

09:13.640 --> 09:19.820
So void of, uh, the void hasn't need, don't need to return anything.

09:19.820 --> 09:22.580
So we will make the remove void.

09:22.610 --> 09:25.190
So void remove.

09:25.940 --> 09:27.950
Integer index.

09:29.750 --> 09:35.960
And lastly, we will create the integer count which will return an integer, obviously.

09:36.800 --> 09:40.640
So this is our list header file.

09:42.440 --> 09:45.950
In next lecture, we will also develop our application, the class files and other files.

09:45.950 --> 09:47.450
So I'm waiting you in next lecture.

09:47.450 --> 09:51.140
Also, we let's actually make this verified corrected here.

09:51.140 --> 09:56.180
So we have done and we are created these methods yet and I'm waiting for next lecture.
