Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
main
Function · 0.45
Calls
3
top
Method · 0.80
push
Method · 0.45
pop
Method · 0.45
Tested by
no test coverage detected