Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- queue<int> rev(queue<int> q)
- {
- stack<int> st;
- while(!q.empty())
- {
- st.push(q.front());
- q.pop();
- }
- while(!st.empty())
- {
- q.push(st.top());
- st.pop();
- }
- return q;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement