Subject:- Data Structure Using C
Made by:- Rahul Sharma
Subject Teacher:- Mr. Jasvinder Singh
STACK
A
Data Structure
What is a Stack?
A stack is a Last In, First Out (LIFO) data
structure,objects inserted last are the first to
come out of the stack
Anything added to the stack goes on the “top”
of the stack
Anything removed from the stack is taken from
the “top” of the stack
Things are removed in the reverse order from
that in which they were inserted
Stack Operations
 PUSH
Adds the object to the top of the stack
 POP
Removes the object at the top of the stack
and returns it
 PEEK
Returns the top object of the stack but does
not remove it from the stack
A LIFO Stack
Top
Bottom
Stack Pointer
Push Pop
Stack 111104232459-phpapp02
Stack 111104232459-phpapp02

Stack 111104232459-phpapp02

  • 1.
    Subject:- Data StructureUsing C Made by:- Rahul Sharma Subject Teacher:- Mr. Jasvinder Singh STACK
  • 2.
  • 3.
    What is aStack? A stack is a Last In, First Out (LIFO) data structure,objects inserted last are the first to come out of the stack Anything added to the stack goes on the “top” of the stack Anything removed from the stack is taken from the “top” of the stack Things are removed in the reverse order from that in which they were inserted
  • 4.
    Stack Operations  PUSH Addsthe object to the top of the stack  POP Removes the object at the top of the stack and returns it  PEEK Returns the top object of the stack but does not remove it from the stack
  • 5.