Comilla University: Department of Computer Science & Engineering Presentation On: Data Structure
Comilla University: Department of Computer Science & Engineering Presentation On: Data Structure
Department of
Computer Science & Engineering
WELCOME TO
OUR
PRESENTATION SESSION
THE NAME OF OUR
GROUP
IS
11 Group
th
OUR GROUP MEMBERS ARE:
SL No Name Roll
Postfix Notation :
When the operators are written after their
operands then the expression is called the postfix
Notation.
Example : A B +.
2 9 +.
EXAMPLE
Suppose Q is an arithmetic expression
written in infix notation . This algorithm finds
the equivalent postfix expression P.
P: ABC+ DE+F*+G/+
Algorithm
) *(+) d c +b a +
Round 1:
0 1 1 2 2 3
34 15 34 29 34 8
Round 2:
0 1 2 3
15 29 8 34
0 1
1 2
15 29 29 8
0 1 2 3
A 15 8 29 34
A
Round 3:
o 1
15 8
0 1 2 3
A 8 15 29 34
ALGORITHM
AAA 1 BBB 2
. .
CC
C
2
.
D
EE 4 FF 4
D
D
4
. E . F
.
G
G 5
G
Figure 1
PRN LINK
INFO
BBB 2 6
7
DDD 4 4
EEE 4 9
AAA 1 1
start 5
CCC 2 3
10
GGG 5 0
Avail 2 FFF 4 8
11
12
0
Figure. 2
Algorithm 1
1. Set Item :=Info [START]
2. Delete first node from the list.
3. Process Item
4. Exit.
Algorithm 2
This algorithm adds an ITEM with priority number N to a
priority queue which is maintained in memory as a one way
list.
1.Traverse the one –way list until finding a node X whose
priority number exceeds .Insert ITEM in front of node X.
2.If no such node is found , insert Item as the element of the list.
Example
Suppose an item XXX with priority number 2 is to be inserted
into the queue in Figure 1
AA 1 BB 1
A . B . CC 2
C . DD 4
D .
EE 4
E . FFF 4
. GG 5
G
Figure 3
THE END