| 14 | cout << arr.A[i] << " "; |
| 15 | } |
| 16 | void Add(struct Array *arr , int x) // element to be inserted |
| 17 | { |
| 18 | if (arr->length < arr->size) |
| 19 | arr->A[arr->length++] = x; // increment the size of array and fit the elements // it will take the constant time |
| 20 | } |
| 21 | void Insert(struct Array* arr, int index, int x) // the index at which we want to enter // and the value we want tpo enter |
| 22 | { |
| 23 | int i; |