KEMBAR78
Introduction to stack | PPTX









Introduction
Primitive Operations Done On Stack
Representation Of Stack On Array
Diagram Of Stack During Push & Pop Operation
Push Operation (Insertion)
Pop Operation (Deletion)
Applications Of Stack
The linear data structure linked lists and array,
allows us to insert and delete elements at any
place in the list,at the beginning,at the end,or in
the middle.
A stack is a linear structure in which assition or
deletion of element takes place at the same end.
This end is often called the top of stack.
Stacks can be also be defined as
Abstract Data Types(ADT). A stack of
elements of any particular type is finite
sequence of elements of that type
together
1.
2.
3.
4.

5.
6.

Intialize the stack to be empty.
Determine whether stack is empty or not.
Determine if stack is full or not.
Is stack is not full,then add or insert a new
node at one end of the stack called top.
This operation is called as PUSH.
If the stack is not empty ,then retrieve the
node at its top.
if the stack is not empty,then delete the
node at its top. This is called POP operation.
Stacks can be represented in the memory through
arrays. Using this concepts, to maintain a linear array
STACK, a pointer variable Top which contains the
location of top element. The maxstack gives the
maximum no of element in a satck


1


Item 1

2

3

4

5

item2

MAXSTACK
PUSH

POP

A
B

B

C

C

D

D

E
F

E
F

BC
DEF
Push Operation: The process of adding new
element to the top of the stack is called a push
operation pushing of an element is nothing but
just adding an element to a stack.
Pop Operation: the process of deleting an
element from top of the stack is called pop
operation as deletion takes place from top of
the stack.


One of the simple applications of stack is
reversal of list. As the characteristic of stacks
are reversing the order of the execution.



Which can simply by pushing an individual
characters and when complete line is pushed
into the stack, then the individual elements of
stacks are popped off.
Introduction to stack

Introduction to stack

  • 2.
           Introduction Primitive Operations DoneOn Stack Representation Of Stack On Array Diagram Of Stack During Push & Pop Operation Push Operation (Insertion) Pop Operation (Deletion) Applications Of Stack
  • 3.
    The linear datastructure linked lists and array, allows us to insert and delete elements at any place in the list,at the beginning,at the end,or in the middle. A stack is a linear structure in which assition or deletion of element takes place at the same end. This end is often called the top of stack.
  • 4.
    Stacks can bealso be defined as Abstract Data Types(ADT). A stack of elements of any particular type is finite sequence of elements of that type together
  • 5.
    1. 2. 3. 4. 5. 6. Intialize the stackto be empty. Determine whether stack is empty or not. Determine if stack is full or not. Is stack is not full,then add or insert a new node at one end of the stack called top. This operation is called as PUSH. If the stack is not empty ,then retrieve the node at its top. if the stack is not empty,then delete the node at its top. This is called POP operation.
  • 6.
    Stacks can berepresented in the memory through arrays. Using this concepts, to maintain a linear array STACK, a pointer variable Top which contains the location of top element. The maxstack gives the maximum no of element in a satck  1  Item 1 2 3 4 5 item2 MAXSTACK
  • 7.
  • 8.
    Push Operation: Theprocess of adding new element to the top of the stack is called a push operation pushing of an element is nothing but just adding an element to a stack. Pop Operation: the process of deleting an element from top of the stack is called pop operation as deletion takes place from top of the stack.
  • 9.
     One of thesimple applications of stack is reversal of list. As the characteristic of stacks are reversing the order of the execution.  Which can simply by pushing an individual characters and when complete line is pushed into the stack, then the individual elements of stacks are popped off.