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

Method dequeue

CPP/QUEUE/QueueUsingStack.cpp:13–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12 }
13 int dequeue(){
14 while(!s1.empty()){
15 s2.push(s1.top());
16 s1.pop();
17 }
18 int ans=s2.top();
19 s2.pop();
20 while(!s2.empty()){
21 s1.push(s2.top());
22 s2.pop();
23
24 }
25 return ans;
26
27 }
28
29
30};

Callers 1

mainFunction · 0.45

Calls 3

topMethod · 0.80
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected