Stack | A complete concept of stack

in #technology6 years ago

A stack is defined as a list in which all insertion and deletion are made at only one end that is called as top of stack ( TOS ). Some of the major components of stacks are,

  • Push - Insertion
  • Pop - Deletion
  • Peep - Extract Information 
  • Update - Update information from a particular location

            

The most recently pushed element can be checked prior to performance a pop operation. A stack is based on the last in first out algorithm in which the insertion and deletion operations are performed at one end of a stack. Also, the information in a stack can only be removed in the opposite order in which it was added to the stack. The most accessible information in a stack is at the top of the stack and least accessible information is at the bottom of the stack.

For example, consider a stack of plates placed on the computer in a cafeteria. During the dinner time customer take plates from the top of the stack and waiter puts the washed plates on the top of the stack. The plates that is put most recently on the stack is the first one to be taken off. The plate at the bottom is the last one to be used.

Sort:  

Hi! If you are good at java and C++ why have you not been contributing on various platforms?

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.033
BTC 63006.70
ETH 3075.91
USDT 1.00
SBD 3.82