際際滷

際際滷Share a Scribd company logo
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

More Related Content

Stack 111104232459-phpapp02

  • 1. Subject:- Data Structure Using C Made by:- Rahul Sharma Subject Teacher:- Mr. Jasvinder Singh STACK
  • 3. 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
  • 4. 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
  • 5. A LIFO Stack Top Bottom Stack Pointer Push Pop