A list is a sequence of items with similar data types where the order of items positions matters.
So there are several common operations that are available in a list of a d t here.
So a the T here.
So we have the get firstly here, the get, which will return the value of selected index in this case
E here for example.
And the if the index is out of bounds, it will simply return the Z minus one here.
Yes.
A list is a sequence of items with a similar data types with the order of items.
Positions matters.
So there are several common operations of the ADT here.
So let's actually here.
So there are several common operations that are available in the list.
Ad t a t t.
Here.
The first is.
And they are here.
So they are.
Let's talk about the get here the get, which will return the value of selected index here.
If the index e is out of bounds, it will simply return minus one.
We also have insert.
So which this insert will insert the value v value at the position of index E here.
So in this case it's our value.
And it's our here is our position.
They also have the search here.
The search will return the index of first occurrence of V.
If the value V does not exist, then it will return the minus one here.
We also have the remote, so which will obviously remove the item in the index.
Here, index E So for simplicity, we are going to build a list, a team that accepts integer data only
from zero and higher.
So now using the array datatype we learned earlier, let's build a new team named list which contains
a preceding operations.
So we need two variables to hold the list items each, which is going to be my items variable and the
number of the items in the list, which is going to be my count here.
So now actually, let's delete this.
And actually, let's move this here and delete those drawings.
Also this.
Here.
Now move it here.
Right here.
Let's keep an eye on him.
And here.
So now we're going to create a new list.
So as I said, we need two variables to hold the list of item, which is going to be my items here.
Mark my items.
It's going to be the my items.
Which is my items will hold the list of items.
And we also need a number of items in the list in the my count here, my count.
So we will have these are the this is our first we will define first and then we will define this later
here.
So our for operations.
So actually we will make them we will make both the both of them.
We will make both of them the private here.
So this these are going to be the private.
Uh, so.
So we will make them private because it cannot be accessed from outside our class here.
So we want to.
We don't want to access this outside of class here.
Uh, so we will also need.
Uh, we will also implement.
The four operations describe previously, we will implement it.
So this these all of these four operations that we you learned earlier of this lecture, all of these
four operations.
Uh, so we and we are also going to do.
In addition, we need a constructor, a destructor and a method to let us know the number of items that
the List class has, which is named count here.
So based on this requirement, uh, let's actually firstly create the list header file.
So let's delete this here.
Delete.
Oops, we don't want to delete that.
Yes.
Here we will use this, uh, methods.
We will look at them.
Here and delete this.
So now we're going to firstly create a list here and class file.
So now.
Uh, right click on the project class list here.
This will automatically create the list header file and here.
Uh, firstly, we if the untitled list arch here, uh, the light also this.
And after that we're going to create the class list.
As you can see, it's automatically created here.
So as I said earlier, we will define private two variables, the which is my count and my items.
So my, my.
Or it's going to be integer integer my items.
And this is going to be we also need the asterisk here.
So my items and integer my count.
And we will define public.
So this this has to be private here.
And we'll also define the public here.
The public is going to be list constructor.
So this constructor here also integer get.
So this is our that we discussed earlier.
This is firstly the get here.
So actually let's uh, whenever we type this, let's actually so we made this get implemented, get
here and now we will implement the create the class, the void, uh, the which is insert class integer
index index and integer value, as I said.
And actually we also need the parameter index here.
So integer index and as you can see here, insert is again done.
And we are also going to create the class integer search which will return integer.
And we need just one parameter here, which is integer value that we value that the heading level one
exiting.
Narrator That's the value we want to search here and we will also create the remove and we will create
the count here.
So void of, uh, the void hasn't need, don't need to return anything.
So we will make the remove void.
So void remove.
Integer index.
And lastly, we will create the integer count which will return an integer, obviously.
So this is our list header file.
In next lecture, we will also develop our application, the class files and other files.
So I'm waiting you in next lecture.
Also, we let's actually make this verified corrected here.
So we have done and we are created these methods yet and I'm waiting for next lecture.