Stack is defined as a list of element in which we can insert or delete elements only at the top of the stack.
The behaviour of a stack is like a Last-In First-Out(LIFO) system.
Stack is used to pass parameters between function. On a call to a function, the parameters and local variables are stored on a stack.
High-level programming languages such as Pascal, c, etc. that provide support for recursion use the stack for bookkeeping. Remember in each recursive call, there is a need to save the current value of parameters, local variables, and the return address (the address to which the control has to return after the call).
QUEUE:
Queue is a collection of the same type of element. It is a linear list in which insertions can take place at one end of the list,called rear of the list, and deletions can take place only at other end, called the front of the list
The behaviour of a queue is like a First-In-First-Out (FIFO) system.