What is a stack?

0 votes
212 views
Anonymous User asked 27-Dec-2017 in Technology by Anonymous User

What is a stack?

1 Answer

0 votes
Sangsaptak Pal answered 28-Jan-2020 by Sangsaptak Pal

Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO i.e. Last In First Out or FILO i.e. First In Last Out. There are many real life examples of stack like the plates in a canteen. There are various operations that can be performed on stack for data retrieval and manipulation. These operations are : 

  • Push : Inserts data
  • Peek : Shows the last inserted data in stack
  • Pop : Removes the last inserted data in stack

What is a stack?