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

Method push_back

CPP/vector-concepts/vector.h:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 arr= new int[ms];
10 }
11 void push_back(int d){
12 if(cs==ms){
13 int *oldArr=arr;
14 ms*=2;
15 arr= new int[ms];
16 //copy the old items to the new array of double size
17 for (int i = 0; i < cs; i++) {
18 arr[i]=oldArr[i];
19 }
20 delete []oldArr;
21 }
22 arr[cs]=d;
23 cs++;
24 }
25 void pop_back(){
26 if(cs>=0){
27 cs--;

Callers 15

bfsMethod · 0.80
shortestPathsMethod · 0.80
findLaddersMethod · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
fFunction · 0.80
mainFunction · 0.80
addEdgeMethod · 0.80
Add_edgeFunction · 0.80
spirallyTraverseMethod · 0.80

Calls

no outgoing calls

Tested by 3

mainFunction · 0.64
mainFunction · 0.64
kidsWithCandiesMethod · 0.64