Professional Documents
Culture Documents
Matrix Multiplication
Stack Data Structure
PUSH Operation
POP Operation
Application of Stack
2. Scan Q from left to right and repeat Steps 3 to 6 for each element of Q
untill the STACK is empty:
3. If an operand is encountered, add it to P.
B= 2 3 5 7
0111
8245
C= 2 *4
Dr. Suresh Kumar Poonia, Associate Professor( CSE) 09/07/2021
Behaviour-LIFO
SIZE=6
Stack[]= {10,2,3,4,5,60}
MAXSIZE=SIZE-1
POP- If (TOP==-1)
Underflow
PUSH- If(TOP==MAXSIZE)
Overflow
Push operation - Top++
POP operation=Top--=2=1=0=-1
Top=-1=0 =1=2=3
Dr. Suresh Kumar Poonia, Associate Professor( CSE) 09/07/2021
Infix Notation= (A+B)/C
Prefix Notation=[+AB]/C= /+ABC
Postfix=[AB+]/C=A B + C /
B[3,2] = 1 4 4
4 5 6
2 2 7