Computer science 2nd pu on stack chapter notes
Computer science 2nd pu on stack chapter notes
DATE
02.STACK.
.Data atudue
A data struduu datins a machanim o sln,oQunig Ord
access dato with openations hat can e tfiity potormad
on th data
Stack
tock iu a lincan dota Ahucua ohu inction and dallion
lan elment akes plau at the sameiud cinny akciud as
a
whee
Stack follougs tho ast in finst out (LIFO) prncigle,ce,
gint one to
tha
the elenent vchich waa inseted lat aill be
todun out iom stack
Applcatiaa stack in nual iy
oStak og books
AStack o bozs
aMultinle ehains in a vetical p i l . t
Plats ananged ome among e othun.
olo seweseia
chanaoten3
shing can be, casilg dore by
hin appeanane in tn
sReening chanauina stack.
placing the
The teat/imag editas
St allouoA usUL to undo sr udo editing oith the most
uCant aditing is undone o sedoe.The systen wses a stack
kupaack a changea madkd aick
Ch Back button on the bro8RA.
alhile bouig a w, e moue kom one
pag
honothu, bu accaAsing lisks betuuxen thn, in eidn to go
back to the dast uisiad wsb page, e may use hei back
kutton on te bnowse, in this co, the histoy o boayd
Page is mainaind a stack.
C)Eopnenion Evaluation
ahil uoriinq any auithmeie equalibn uëte paianthuis
Alhile exitiling the pcqnaim, the. compido chacks kgn matched
pananthes ncae thi pananthis is mismatchad, the compin
Inuda to thos an e1n97.
To handlemotching a paranthiastack is wnd
Opnations on ack
POP openation
o POP opuation is_uud to umoUe lhe topnost ement oy th
utun Fal
etun Nont
else
aaunlalas stack.pop())
else:
print ("pintCpopped lameit iaitu)
glau a
-pepped elumut i glas a
Pppped oluent i glas
undefous
ack in emp nas
Notations fon Anithmelic Enpnsiana.
dota sucRL..
Scan the infisz exprasioÝn hom ugt to night
PAGE N0:
DATE:
takhenua
a wqet on qpand add it to thu potja cxpauian
and ih ue gat an tpenaton e pasunihuja add it io the stack
by maintaäning thia pnudun.
Conutlan of pnson hom Sniz to postia notation.
Stap 04- it is "'pop_ Rom thu stack and add to potpia until
yau kind a C,then discaxd both panunthuis.
Result : s +z8 */