Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Date

DELTA PO No

Data Stavchyae
1)Deline data shuctuae In houo many toay8 can yev
Categox2e data &tau ctuaCA Cnd Explain eauh e them

ada tavcwae 3 he Onganfsed celectiom


dlata n a pantiulan foxncct Pa aalled cloata
shuctat. Nomally olata stoucie 98 iided ato
f o ype

Lineon Bota 8 tovchuaeR


A neon_data stavctvae have dcta elomentr
v2nanged n sequenial mannen and euh
membe element z cennecked to paene and
next elememt E. Axzay nkod 1fst, stauk
CQueLue

QTnay g a lin2on callectien B o l a t a


ASTO
elemenb ofth 20m clataty/2

n k o d list- A inR d e t Rs a ttecetleesg99


t a elam ep Seqvence nk& uoh ch_Leiain
CL CODnectton to anothen unk. kinhed ust fe
he secend most ed-used data staucte

Statk Stuik Pa a_inean celdechion dato 9lem


o ohich nsenion
op
oleletiem takes plaie ct only
enk end callpdaalk. 3 also knewn a
Last in s t eutL EO)
Date
DELTA Pg No

nend
uUR Queue a a linea s t f dota LLmA
tcohichPnsenhon take place called 2en d
Qlatien takes plae ot anolhe_ end Called fsont

2 Nem Inean bata 3s/ctuae


nen-iaean_data 3tudv hasn0 Se
cennechne al 3 elemends and
Seqven cR
eah elemèntcan bare mubbiple padhsto
Cennet Ho othen elementssq 78ee and 2apl2.

Tel
Thig h u t - e Pa nesthy USed tD Cpesert
data celaining a hienanchical azelaienhip
betuoeen elmrts e.9aeco&C relcctiem3 ae
and fohle e Lemknh.

L xaph=A Gaph Cnmay he olehned a3 a


hnieSet V_ VOH.cos_andA Sef E B edgel
Date
DELTA Po No

L 20, 23, 5,3,,1, 6


Tem- 2 0 TLem-23

1 (11)0-2--2

20 23
(23)

Tem-5 THem- 3

20 (20)3-1=2

23 23
3
Hem-

(20

(23)
(23

Tem-9 THem 6

20

( ()
S 4 De-

Date
DELTA Pg No

ENaluakt ha feleing posthr eK p2ORiO2


LSin Staks.
32, LO, 1o, 60, 100,

Posth xp>e8iom
3à01o,* 10, 60 10

Add get poran-the2Pg Ra te laat epoTAX_


expaea@m
320 1o,,1o 60 1e0

SyMBOL STA CR
2-0 3-0
LO,320
3200

Go CLOa, 60, 1O,32 V


Leo Loo 6o,TO 2290
GO001O220

18 5
18.9
Alqorithm for evaluation of Postfix Expression
at the end of postfix expression
Step 1: Add a right parenthesis the step 3 and
expression from left to right and repeat
Step2: Scan each operator of postfix is encountered.
step 4 until the right parenthesis
encountered then add it into
the stack.
Step 3: If an operand is 2 elements from the
stack and assign with
encountered removetopthe
Step 4: If operator is
stack.
will be in the Top of the
Y operator X. Result
X and Y. After that perform
Step 5: Set value =
Top of the stack.
Step 6: Exit
Stacks
45
Algorithm to Convert Infix to Postfix
Expression
Step 1: Add left parenthesis into the stack and add right parenthesis at the end of infix
expression.
Step 2: Scan the infix expression from left to right and repeat step-3 to step-6 until the stack
is empty.
Step 3: If an operand
is encountered add it to the
postfix expression.
Step 4: If a left parenthesis is encountered then add it into the stack.
Step 5:
If an operator is encountered then
repeatedly delete all the operator from the stack
which has the higher precedence than the incoming operator.
same or

Add all deleted operator into the postfix expression and add the incoming
into the stack. operator
Step 6: If a right parenthesis is encountered remove all the
operator from the stack up to
the left parenthesis and add these deleted into the postfix expression and
operators
remove the left parenthesis from the stack.
Step 7: Exit
Example 1
Convert Infix expression in to the Postfix expression:
5°(6+2)-12/4
Add right parenthesis in the last of Infix expression
5°(6+2)-12/4)

Symbol Stack Postfix

(
6 ( 5,6
((+ 5,6
((+ 5,6,2
5,6,2,+
5,6,2,+,
12
5,6,2,+,',12
(-/ 5,6,2,+,,12
(-/ 5,6,2,12,4
5,6,2,+'12,4,/
2,3,+,4,2,*
Example4
Convert Infix expression in to the Postfix expression:
A-C+D/BA
Addright parenthesis in the last of Infix expression
A-C+D/BA)
Symbol Stack Postfix

A A
A
C ( A,C
(+ A,C,
D + A,C,,D
(+/ A,C,-,D
B (+/ A,C,,D,B
(+* A,C,,D,B,/
A (+* A,C, ,D,B, /,A
A,C,-,D,B,/,A,',+
Algorithrm for evaluation of Postfix Expression

You might also like