@@ -16,7 +16,6 @@ public :
1616myArr = new int [arrSize];
1717};
1818
19-
2019// Operations on Arrays
2120// 1- Fill
2221void Fill (){
@@ -49,6 +48,7 @@ public :
4948return index;
5049};
5150
51+ // 3- Appending
5252void append (int newItem){
5353if (length < size){
5454myArr[length] = newItem;
@@ -59,7 +59,7 @@ public :
5959}
6060}
6161
62- // 3 - Insertion
62+ // 4 - Insertion
6363void insert (int index, int newItem){
6464if (index >= 0 && index < size){
6565for (int i = length; i > index; i--){
@@ -73,8 +73,7 @@ public :
7373}
7474};
7575
76-
77- // 4- Deletion
76+ // 5- Deletion
7877void remove (int index){
7978if (index >= 0 && index < size){
8079for (int i = index; i < length - 1 ; i++){
@@ -87,7 +86,7 @@ public :
8786}
8887}
8988
90- // 5 - Increase Array Size
89+ // 6 - Increase Array Size
9190void enLarge (int newIndex){
9291if (newIndex <= size){
9392cout << " the new size must be larger than current size\n " ;
@@ -104,7 +103,7 @@ public :
104103};
105104};
106105
107- // 6 - Merge two Arrays
106+ // 7 - Merge two Arrays
108107void merge (Array other){
109108int newSize = size + other.getSize ();
110109size = newSize;
@@ -122,7 +121,7 @@ public :
122121};
123122};
124123
125- // 7 - Display Array Items
124+ // 8 - Display Array Items
126125void Diplay (){
127126cout << " Display Array Items\n " ;
128127for (int i = 0 ; i < length; i++){
@@ -131,12 +130,12 @@ public :
131130cout << endl;
132131};
133132
134- // 8 - Get Array Size
133+ // 9 - Get Array Size
135134int getSize (){
136135return size;
137136};
138137
139- // 9 - Get Array Length
138+ // 10 - Get Array Length
140139int getLength (){
141140return length;
142141};
0 commit comments