When using stacks and queues for standard libraries, first include related header files
#include <stack>
#include <queue>
The definition stack is as follows:
Stack<int> Stk;
The definition queues are as follows:
Queue<int> Q;
The stack provides the following actions
S.empty () returns true if the stack is null or false
s.size () returns the number of elements in the stack
s.pop () deletes the top element of the stack but does not return its value
s.top () Returns the element at the top of the stack, but does not delete the element
S.push () presses the new element at the top of the stack
The queue provides the following actions
Q.empty () returns true if the queue is null or false
q.size () returns the number of elements in the queue
q.pop () deletes the first element of the queue but does not return its value
Q.front () returns the value of the first element of the team, but does not delete the element
Q.push () presses the new element at the end of the team
Q.back () returns the value of the tail element of the queue, but does not delete the element