Data Structure Basic Notes
Data Structure Basic Notes
Sionplea to fmplemet
4. Moye Camplex to
Prnplement.
Can be yed for
Can be cyed for Sructues ioyplenmeuty data
tmplementrg dada trees. Strutunes te aroys
lists ard
('lke Ifnked ound taces.
mermary (ess menory i
Regyusres veqjuired ag ho
for Pointers Potntens needed
Con be sed for dyranse Suttable for ttatie
dota structuney. doda Strutuey
Plexible in terms of Fixed-size and
Size and Strutne Stuctue.
?s pochle
13: Obn haie mutiple only one bead
heud and tail pointong
Can bae Vanable lerqth .
int data;
Shut nae ret:
4800 8000
Dale linked lit
tA dole 1aked |ated lit
t is Speei Hen
to tte previouy
fach node Conte ns a poanten
node the nest nae of e (ned
list
* It aloas tor
S both -fondand bockoad traven
ch mates onent ke gertion o.nd delefbn
ot both
ends more eftident
Vieus otf Double inked lit
oo|head
Sthuct node
600
600 Roo
ft data;
Shud node * next,
sut nod e prev;
fnt data
Shut noe
*next,
lht is E presston ! Discugs tte types of Pxpvesion ih
an exoumple.
Comliralon of oferaors,
Expresuion An exprerion is a fomdamental uat
Vaia.Gpretons
xpveions ae a
(onshoats d Vanialley. porform Caloaon,
progvanming, g theyae cged to
of ond procace veslt.
male decitors, opevtovs.
Ex eslt >opevonds
Vanible to stove
te expreufionValue penfom Mathemat'lGolele
mutiplatioo
Athmeie ex pvegsons:- Ts Sltraction,
1. dition,
| e addit'on,
openctrs
and division.
h>
B:- #iue <stip. The vesHis:2
int mainc)$
fnt a- s, b= 3;
nt vet a t ,
YeHs: d yesJ);
ve
Pintt Yeyt
vetnn;
expretions Campane
Relatioral
Reattond Bxpvession:- flse)veslt
. boolean (true cor)
edueg ad vetun a incude eaaliy (==), îreyuoity
Comnon velatoral operts (1-)
qyeatentan(), les than (e),ete
- #cludecstdio:hs
int mainCS
asb;
iat ves t=
aqveaten thanb?d,yeslt)
Pintt 'Is
Yotun;
qreator thanb o| Fodse
nens Tre.
*whe 'o'mepretalce ond
lorjcas copreton Cornblne
loteol opevetors like
(?ke AND(R),
Lpuleon for moliry
one often yed
deisions and controltg
lkmple # nchdeestdio. h> output
Result:I / Tyue
vetunO;
3
6.funtion Cxpeasions:
Con cal funtny ond
method
Call Can be
po
Considened as effiiet.
stack,:ted ligt
ole nt
Yevense placed
l
onyartely
elemets t e
Tree and qroph
Arays
Collecon of Hems toved at Contsoug merorg
*htiple temg of Sane
lotig.
The ftrst elemeut
neanchig Sorfr by Subsuipto.
Possible. ravenig tind of qpect
3
12243%
Revense p l:sh
Exople:- Sevegsion=+3*u"
both notatios, .
Tn polish Noteion:
Crginad ExprestioniQ+3*s"
PN vepregenttion:-+*34
1+"’ Opevont i:
J.*"p
erentl:3,opencnd2:4
resutt is Qt12=4.
is , So ttnat
3. The vesdt of
0*rd epreilion")+3"u
KPN aepreterntadtn:" 3u*+"
1. Dperondl:
operords:3
3- operatr
operandl:
operator:4
regult ot'+" (1+1)?s 4.
Exlatt- the tortept
Whot is steack and bbasc openatton
gpettn thherample
AGHact is o lBnean dat îhhich he
trute
Dfone elemet and emovad af ins ention
an existig lenet
totes place ot te Some end
ot tte Steck. vepvejerted a te top
LIfO Clogt n Pirt out)
is Strategy Stoteg that tte elemetthat s sertd
lagt l Come int. ou tan take a ple of
kept ontop of each otes ong o plates
Te plate csbich e Put layt s onte veal-fe exanfle
Sinee ue
tbp an
vejve HaPlate that Ps o tte top,
Soy thet e plate hat a pt
pit lagt
lat Come
ot fvst. Puthitem
Ph Pop pop te
Bate openal'og on stack
Rae
in a Gtaet,thene ane
make maniodato
Ta order to
to u
(etoin operatiors pr ovi ded ircto the stack
to elemet
* puyhl)i- faseat n
from the tact
an
on elemet
y DoP C)-to remove
elemet of the Steact
top)- Retn the to empty elefolge.
* t stack is Yeurtakel 7
0:- yetans te
* sfmhy orf ta ck.
si2e
Sze):- Vetuns te
Tof-o
S4akefo]-!
Tof -l
eytyset