MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / insertatbottom

Function insertatbottom

03. Recursion/reverse_stack.cpp:8–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 cin.tie(0); \
7 cout.tie(0);
8void insertatbottom(stack<int> &st, int ele)
9{
10 if (st.empty())
11 {
12 st.push(ele);
13 return;
14 }
15
16 int topele = st.top();
17 st.pop();
18 insertatbottom(st, ele);
19 st.push(topele);
20}
21void reverse(stack<int> &st)
22{
23 if (st.empty())

Callers 1

reverseFunction · 0.85

Calls 4

emptyMethod · 0.45
pushMethod · 0.45
topMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected