Objects can be inserted less than the limit of the stack,but the removing is done only from the last element. Inserting an item is known as "Push" and removing an item from the stack is known as 'Pop'.
A stack works like a books in the shelf.You can insert books in the shelf but can only remove the books from the top that is the last book inserted. Here is a program implementing stack in C++.
No comments:
Post a Comment