1
00:00:01,120 --> 00:00:07,810
A list is a sequence of items with similar data types where the order of items positions matters.

2
00:00:07,810 --> 00:00:15,850
So there are several common operations that are available in a list of a d t here.

3
00:00:15,850 --> 00:00:20,170
So a the T here.

4
00:00:20,470 --> 00:00:30,910
So we have the get firstly here, the get, which will return the value of selected index in this case

5
00:00:30,940 --> 00:00:32,410
E here for example.

6
00:00:33,100 --> 00:00:42,940
And the if the index is out of bounds, it will simply return the Z minus one here.

7
00:00:44,280 --> 00:00:45,300
Yes.

8
00:01:49,400 --> 00:01:55,520
A list is a sequence of items with a similar data types with the order of items.

9
00:01:55,520 --> 00:01:57,500
Positions matters.

10
00:01:57,500 --> 00:02:01,550
So there are several common operations of the ADT here.

11
00:02:01,550 --> 00:02:03,380
So let's actually here.

12
00:02:03,380 --> 00:02:08,090
So there are several common operations that are available in the list.

13
00:02:09,490 --> 00:02:13,890
Ad t a t t.

14
00:02:13,930 --> 00:02:14,530
Here.

15
00:02:14,620 --> 00:02:15,610
The first is.

16
00:02:15,640 --> 00:02:17,080
And they are here.

17
00:02:17,080 --> 00:02:18,250
So they are.

18
00:02:18,280 --> 00:02:27,190
Let's talk about the get here the get, which will return the value of selected index here.

19
00:02:27,520 --> 00:02:35,290
If the index e is out of bounds, it will simply return minus one.

20
00:02:36,340 --> 00:02:38,050
We also have insert.

21
00:02:38,050 --> 00:02:47,890
So which this insert will insert the value v value at the position of index E here.

22
00:02:47,890 --> 00:02:50,800
So in this case it's our value.

23
00:02:52,380 --> 00:02:57,150
And it's our here is our position.

24
00:03:02,090 --> 00:03:04,240
They also have the search here.

25
00:03:04,270 --> 00:03:10,570
The search will return the index of first occurrence of V.

26
00:03:11,650 --> 00:03:19,420
If the value V does not exist, then it will return the minus one here.

27
00:03:20,410 --> 00:03:26,760
We also have the remote, so which will obviously remove the item in the index.

28
00:03:26,980 --> 00:03:36,460
Here, index E So for simplicity, we are going to build a list, a team that accepts integer data only

29
00:03:36,460 --> 00:03:38,380
from zero and higher.

30
00:03:38,560 --> 00:03:45,790
So now using the array datatype we learned earlier, let's build a new team named list which contains

31
00:03:45,790 --> 00:03:47,680
a preceding operations.

32
00:03:47,680 --> 00:03:55,390
So we need two variables to hold the list items each, which is going to be my items variable and the

33
00:03:55,390 --> 00:03:59,320
number of the items in the list, which is going to be my count here.

34
00:03:59,740 --> 00:04:03,550
So now actually, let's delete this.

35
00:04:09,000 --> 00:04:15,120
And actually, let's move this here and delete those drawings.

36
00:04:18,100 --> 00:04:18,940
Also this.

37
00:04:20,070 --> 00:04:20,690
Here.

38
00:04:21,180 --> 00:04:22,550
Now move it here.

39
00:04:22,560 --> 00:04:23,640
Right here.

40
00:04:23,640 --> 00:04:25,820
Let's keep an eye on him.

41
00:04:25,830 --> 00:04:27,030
And here.

42
00:04:27,060 --> 00:04:30,150
So now we're going to create a new list.

43
00:04:32,660 --> 00: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.

44
00:04:43,660 --> 00:04:46,300
Mark my items.

45
00:04:46,330 --> 00:04:50,800
It's going to be the my items.

46
00:04:53,030 --> 00:04:58,460
Which is my items will hold the list of items.

47
00:04:58,460 --> 00:05:06,710
And we also need a number of items in the list in the my count here, my count.

48
00:05:08,570 --> 00: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

49
00:05:14,270 --> 00:05:14,750
here.

50
00:05:15,830 --> 00:05:17,570
So our for operations.

51
00:05:17,570 --> 00:05:22,610
So actually we will make them we will make both the both of them.

52
00:05:22,610 --> 00:05:25,880
We will make both of them the private here.

53
00:05:25,880 --> 00:05:30,470
So this these are going to be the private.

54
00:05:34,420 --> 00:05:35,660
Uh, so.

55
00:05:37,450 --> 00:05:38,240
Uh, so.

56
00:05:38,250 --> 00:05:45,030
So we will make them private because it cannot be accessed from outside our class here.

57
00:05:45,030 --> 00:05:46,300
So we want to.

58
00:05:46,320 --> 00:05:51,360
We don't want to access this outside of class here.

59
00:05:54,220 --> 00:05:57,040
Uh, so we will also need.

60
00:05:59,770 --> 00:06:01,240
Uh, we will also implement.

61
00:06:02,120 --> 00:06:05,270
The four operations describe previously, we will implement it.

62
00:06:05,270 --> 00:06:14,480
So this these all of these four operations that we you learned earlier of this lecture, all of these

63
00:06:14,480 --> 00:06:15,710
four operations.

64
00:06:17,720 --> 00:06:20,660
Uh, so we and we are also going to do.

65
00:06:20,930 --> 00:06:28,130
In addition, we need a constructor, a destructor and a method to let us know the number of items that

66
00:06:28,130 --> 00:06:32,630
the List class has, which is named count here.

67
00:06:33,770 --> 00:06:40,760
So based on this requirement, uh, let's actually firstly create the list header file.

68
00:06:40,760 --> 00:06:44,510
So let's delete this here.

69
00:06:44,510 --> 00:06:45,470
Delete.

70
00:06:46,550 --> 00:06:48,590
Oops, we don't want to delete that.

71
00:06:48,800 --> 00:06:49,610
Yes.

72
00:06:49,700 --> 00:06:52,960
Here we will use this, uh, methods.

73
00:06:53,210 --> 00:06:54,320
We will look at them.

74
00:06:55,280 --> 00:06:57,360
Here and delete this.

75
00:06:57,380 --> 00:07:01,760
So now we're going to firstly create a list here and class file.

76
00:07:01,970 --> 00:07:03,290
So now.

77
00:07:05,160 --> 00:07:08,660
Uh, right click on the project class list here.

78
00:07:08,670 --> 00:07:12,960
This will automatically create the list header file and here.

79
00:07:14,310 --> 00:07:20,700
Uh, firstly, we if the untitled list arch here, uh, the light also this.

80
00:07:20,700 --> 00:07:23,610
And after that we're going to create the class list.

81
00:07:23,610 --> 00:07:25,670
As you can see, it's automatically created here.

82
00:07:25,680 --> 00:07:32,970
So as I said earlier, we will define private two variables, the which is my count and my items.

83
00:07:32,970 --> 00:07:35,370
So my, my.

84
00:07:37,230 --> 00:07:41,220
Or it's going to be integer integer my items.

85
00:07:41,610 --> 00:07:44,130
And this is going to be we also need the asterisk here.

86
00:07:44,130 --> 00:07:51,510
So my items and integer my count.

87
00:07:53,090 --> 00:07:54,590
And we will define public.

88
00:07:55,100 --> 00:07:57,680
So this this has to be private here.

89
00:07:58,370 --> 00:08:01,010
And we'll also define the public here.

90
00:08:01,370 --> 00:08:03,440
The public is going to be list constructor.

91
00:08:03,980 --> 00:08:08,990
So this constructor here also integer get.

92
00:08:09,260 --> 00:08:12,410
So this is our that we discussed earlier.

93
00:08:12,410 --> 00:08:15,110
This is firstly the get here.

94
00:08:15,920 --> 00:08:24,680
So actually let's uh, whenever we type this, let's actually so we made this get implemented, get

95
00:08:24,680 --> 00:08:36,140
here and now we will implement the create the class, the void, uh, the which is insert class integer

96
00:08:36,140 --> 00:08:40,490
index index and integer value, as I said.

97
00:08:40,580 --> 00:08:43,850
And actually we also need the parameter index here.

98
00:08:43,850 --> 00:08:50,360
So integer index and as you can see here, insert is again done.

99
00:08:50,360 --> 00:08:57,680
And we are also going to create the class integer search which will return integer.

100
00:08:57,680 --> 00:09:04,580
And we need just one parameter here, which is integer value that we value that the heading level one

101
00:09:04,790 --> 00:09:05,270
exiting.

102
00:09:05,270 --> 00:09:11,720
Narrator That's the value we want to search here and we will also create the remove and we will create

103
00:09:11,720 --> 00:09:12,740
the count here.

104
00:09:13,640 --> 00:09:19,820
So void of, uh, the void hasn't need, don't need to return anything.

105
00:09:19,820 --> 00:09:22,580
So we will make the remove void.

106
00:09:22,610 --> 00:09:25,190
So void remove.

107
00:09:25,940 --> 00:09:27,950
Integer index.

108
00:09:29,750 --> 00:09:35,960
And lastly, we will create the integer count which will return an integer, obviously.

109
00:09:36,800 --> 00:09:40,640
So this is our list header file.

110
00:09:42,440 --> 00:09:45,950
In next lecture, we will also develop our application, the class files and other files.

111
00:09:45,950 --> 00:09:47,450
So I'm waiting you in next lecture.

112
00:09:47,450 --> 00:09:51,140
Also, we let's actually make this verified corrected here.

113
00:09:51,140 --> 00:09:56,180
So we have done and we are created these methods yet and I'm waiting for next lecture.
