A stack is a Last In, First Out (LIFO) data structure where objects inserted last are removed first. It has operations like PUSH which adds an object to the top of the stack, POP which removes and returns the top object, and PEEK which returns the top object without removing it. The document was created by Rahul Sharma about data structures using C for the subject teacher Mr. Jasvinder Singh.
1 of 7
Downloaded 14 times
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