1ArrayList()
2{
3int items = 0;
4int landex=0;
5int *List= new int [items];
6}
7
8//Add function
9add(int n){
10arrayList[landex]=n;
11items++;
12landex++;
13
14if(items==landex)
15{
16arrayList=doubleCapa(arrayList, items);
17}
18}
19//deleteLast()
20int deleteLast()
21{
22int num=0;
23if(arrayList!=0)
24{
25numD=arrayList[size];
26arrayList[size]=NULL;
27if(items<landex*2)
28{
29arrayList=halfSize(arrayList, landex);
30}
31
32
33}
34else
35{
36cout << "Array contain no element";
37}
38
39return num;
40}
41//Size() functions
42int size()
43{
44int num=0;
45for(int i=0;i<arr.length;i++)
46{
47if(arr[i]!=NULL)
48num++;
49}
50
51return num;
52
53
54}
55//
1Definitions of functions of the ArrayList are:
2
3ArrayList();
4void add(int n);
5int deleteLast();
6int size();
7~ArrayList();
8
9Some declarations:
10int items;
11int landex;
12ArrayList doubleCapa(int* a, int l)
13ArrayList halfCapa(int* a, int l)
14int *List;