Introduction to Stack [Data Structure]

Leave a Comment
It is last-in-first-out data structure last inserted element is deleted first it has only top pointer indicating top most element in the stack


Operations

Push inserts element into stack by incrementing top pointes.
Pop delete element from the stack by decrementing top pointes.

Stack can be implemented both using
  1. Arrays
  2. Linked lists

Applications of stack
  • It can be used in design of compilers.
  • Evaluation of arithmetic expressions.

0 comments:

Post a Comment