stacks in data structure

Stack in data structure    is a linear data structure in which insertion and deletion can  take place only  at

One end that is known as top of the stack. It is also known as  LIFO system(LIFO  stands for last in first out)


In  other word a  stack is a homogeneous  collection of item, arranged in linearly with access at one end only called the top.

This means that the data can  be added or removed from only  the top.


Stack is a straight information structure which permits any kind of operations on just top of stack .

Stack fallows specific request just i.e. LIFO( Last In First Out) or FILO(First In Last Out).

Operation of the stack

Different operation

  1. Push operation   — it means insert an item into the stack. includes a thing in the stack. On the off chance that the stack is full, them it is said to be a flood condition.
  2. Pop operation  — it means to delete on item from the stack. expels a thing from the stack. The thing are flown in the switched arrange in which they are pushed. In the event that the stack is void, at that point it is said to be an undercurrent condition.
  3. Peek operation – if one interested only about the information stored at  some location in a stack then peep operation is required. get the thing from stack without pop.

The most effective method to comprehend a stack for all intents and purposes

There are numerous genuine cases of stack.

Consider the straightforward case of plates stacked more than each other in bottle.

The plate which is at the best is the first to be expelled. i.e. the plate which has been set at the base most position stays in the stack for the longest time frame.

Along these lines, it can be basic seen to take after LIFO/FILO arrange.

how to use stack

A stack can be incremented in two  ways

  1. Linked list implementation.