Sample - Bank Management System
Sample - Bank Management System
AND ALGORITHMS
Stack
What will be discussed
Stack Overview
Stack Operations
Implementation of Stack
Stack Overview
Stack ADT
Basic operations of stack
Pushing, popping etc.
Implementations of stacks using
array
linked list
The Stack ADT
A stack is a list with the restriction
that insertions and deletions can only be performed at the top of the
list
top
B
top top
A A A
top
Implementation of Stacks
Any list implementation could be used to implement
a stack
Arrays (static: the size of stack is given initially)
Linked lists (dynamic: never become full)
Push
(1) Increment TopOfStack by 1.
Pop
(1) Set return value to Stack[TopOfStack]
ANY QUERY ?