Posted By:
4 Jul, 2013 1:36 pm PDT

Stacks in C++

What are stacks? How can an element be inserted and deleted from a stack?

A stack is an ordered list in which insertion and deletion are done at one end, where the end is called as top. The last element inserted is the first one to be deleted. Hence it is called Last in First out (LIFO) or First in Last out (FILO).

When an element is inserted into the stack, the concept is called push, and when an element is removed from the stack, the concept is called pop. Trying to pop out an element from an empty stack is called as underflow and trying to push an element in a full stack is called overflow.

Was it useful?  

Please login to reply to this problem.