MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / Add

Function Add

Arrays/05_inserting_an_element.cpp:16–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 cout << arr.A[i] << " ";
15}
16void 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}
21void 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;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected