0 ratings0% found this document useful (0 votes) 117 views30 pagesData Structures Notes Unit 1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Sdddisiveen ssoatittle
dddddd
dome
Be scasvverv
Dota 3 Doto js collector Jnfonm oon
But st Je in sowwforim « Whin Doda JA
poked it! becarus am nfanm akon.
Deda whe hoy >» Tt xa Ae eon
Crtgar ass all dota tons toed, Cone ltt
pot “tht elenunt but ako hue
culetionstu'p 0 each oth:
‘ota Itz chu) 18 supruasutotten of :
bogicak , ruletbionestup | extating b/w srdiviseo
elements yf dota j
data wtructou 1 atro hkfined
prot atte ol and Logical nod of
porticelon eriganisation of date étous:
“an
Dota wtruetwu we brcchdtrg block
4 pape:
Chassificakion Cy
Data structsfi y
purities ps [Nev puri
l J J J [
Fined) Choo] [pore Le] ope
Tanne] oe
ros
Lf ose
Fue]. Peoerh
c=
y wv
Stack Gene]
prime ose ~~
ce
. Thuse coe bane DS ond
giructly eporoted upon mackint srastoucttorg ©
99
é
The Anu diffourt suprusitotien on omg
diffount conaputiou Se
Bye Int , Float, chan prnter So
os
Rs a
fon pres teed . . ' ae
he Non prunes Ds wu 23
queued prone priprtbice data yotructWwu | wy
Tue wee dased on ptsuetwury of 2 7? oc
Lunn hype) @2 Actercogtnio4~ wel
ae
oe
Co fonagers ays
Hada tom:
Ce
rw
Lust, o¢ collector
data ‘etonu'- Aid’ clement
of yorucble' no
te Aue fe:
) yf lst past Osc
G.Deite, filed, Cptartieg oy Data’)
Addruaa')’
Udaterfietd) cmd ont
field):
Cl) Add. field Cn
Gre po ptorelng Data
for gstorury adduss (addruré
Fil > . :
Ee deol weth outset of data
(Shortage cme sh compuber pregrarsing
Tt atlowe, uni fo osughe
fang vay. .
Progtam Ho ‘ower ond ure she deka’ tn
Linen?
Stack a . :
tt os am oder List dn which 9)
addition ff pwd data xtoms and delacon
of out existing tons (a done frm A
pouty ont end, feroco oA top of Blah)
\ Ptacks JB sancally works on LLFQ 4
Li £0 oT ae
dae in prt oot “OiyyUUs > . oe
———" Td fh & Non pound ‘
(Structure Et hc ha panynond coltection ©
4 oltmurt ph which nuv elite ou
addid kn whet, ont amd end called, He
"Recor knd' omd the exiting elomudts DIL us
dhevted fiom othr end called thi Pront SF
dq . t By acd
Gur J6 barcontly maths on FLFO
Kz O vil een
pint tn fint Cut
VC? tis nin Lintan dexta etnuctuot -
tn whith. items, aru asvrounysd tn gshanted
peguenct TE ip umd -te weprissnt hiprpides
sulationshsy anny gsetwvial deta sors
Poot node :
» Left aH chite "
sultreel@ 0 if o avs subtree of a
2
(ay ey ee ee
CCCOCTE EES
rd
SOCbCEE
+ ge
se te My a i
PPD graph 'G coniat of wrbies"y"
ond a exe cf ected Gorden) "Et de danotdl
by 6 (ve) * 4
yo as a
o
bbbtint gas [aint 2 Be] fk]
£
nt, dumee
. on, (+4)
pe Cee0, egy br
é
gums sume aly!
4
steton, Sam 9s
tan | Fag tant
£ ~
sieckwoan 0
roth | OAT Threw comp
eSpact Complircsty >
‘ Thy Gpaee compurcity
can be defined ct amount. af masncosy / oS pack
sugeurrued by aw cllgnrutim -to sush«
+ Constant
* Zrtanen cf
to comput Hu conmplraty au un wo
factors .
SH C+S,
wpue @ ~P
yet ed Content Foahone cba
PPP
p>?
bobs
qSum Com)
G= 00!
fo itn go
St igr ace];
Le
=. matuwtn S$
= S
> 2
we cee
pa coef a
= pons omy
coe 8 eS yarcy | Obd
= cide. ot
9 Se | ow
se " . a
: Aayraptotte Hetations - Anyriplote notations
Par a a phorttd comy to cups Hs Hime
Compt clty
°
=
a Vorveus nototens euch. 4 '9', we
wg} aru usd for cateallochiny time corn pimeitys
ae .
Big oh notation =
oe tt ue denbted by
I
d
Le ipo rtd
of edgonithonia
aio Using big oh natation” yar con give lore
) a] Uw takan by Huadgpnittinm 4°
of supurding Hu upp bound
sinniy Hite
P
opmount
complite-
Dedhition + jut fry goy ee 2 nore ny famat
Sat he £ 6 amt tuo s'rteguu purt thot Me
22 PPP?= fos fn=3
duniles qyonut yout of
miley ¢ iB gone cornstarch euch Hot teeta pony
cow write f a i
ag [FOL aes
—_> a
=> pn ne shied FLOS 2
ba 7 ; ‘ Ime
oe thw abiwoyh Upy! bound af eviating H
Lot ovetetion
SD Las ober by
Hu compa lty yor
ae Foo Col curled! 1g
' ou dane Cam
alyorstoom tharu
(ify Auras com”
cbt eb
ppopy
eCECLE
Fed
Bay hom 96) JB tte of) fev
conptomt ic)! ey r /
Orange noteins
CLE He deviated by Lia"!
a) Le Ja umd to upset Lo
Ex Conpidin fimeiton fia 2nve 9 ger ©
thom nn Bout fo find Bor, conttery¢
wus Round
Wo thot finds c# ge) :
gipent of 4 eslgant Hom Surrey Hi:
; ce a Uning orngon notetion cet com denote
gous ch Shortt armaunt of time’ tole by
ae atgeruthun-
CLS Repnition 3 A function feo4,is oid fo be
gpy2 y ote LAGE Af “for 4a) boumed a&, Bore pent
compan ja multiple of gry putt ified
; for odd Nard noOrtpitons Lup fey4 gh) be due mon iu
y Gree fe) a fumetiond- thurs ou “tube tive consterda
fe) ck ge) SR Foe Suck, dhalergn: fle oBser
= U4
1 [o> gen}
Trou notation «J
h Fuk denofed by 8,
ae this imuttiod thu sunvin, teu Pye
Tuspeu bound», ond Jousin Bowrd
ena be jorteuh om nu Com dnote cutyy
eM OM of FerES ie
”
LC doyn CTR on © nhan crt Cnc nhene 60
La ape tan
Bi'g ok nop CO )
foun
a
ange
0
Abstract Datu typrov) a
; ADT 16 tuppl: of
OC eet ci domeing), £ ( Set of fumctioré) ,
(Sut of Axiomé) un cohich erty what Ja
fo br dor 48 mention but row jp tO be
dont 4 not ratntion+ gn ADT alt Hu implnm
decile cow gikun Adder eb.
AOT = dypi+ Funchon mame + brhauiauned|
Pinetien |
[ad NE
wad jn’ data stout -
fe =) Tt cruster doe bos
oy 3 Thig oputet'n Ja fon alaplauyiny all
‘ the elurunts of dette atruchuus
Incsintion 9 By this opuretion
lon 9 By this epuretion any duanud : .
eamunk com br diluted flor thy
spota (Strutet WU +
cations (is opyetim modified Hu
_. digimd elumenta yoluu by
aigiud nus valu:
i
iad
aid
op
SP GD Qe implort
o>
ope
cfs
op
©
o
ele
a
Toth ett
tl i ‘ ce munks ove
Youuiow ADT opurotions = TP avitem gtd fn Line
rS
oS
ro
rn
el
OLE se used for supupantings
Go Tne irmplomurdaction dese
Advorntag.s BH ADT =3 ‘ "
ie 4 oth opuations
‘9 Hal deter, got rection » ,
il com by Aiddn
jn p07 ¢ i i
ation dobddla carn be charge
lodten on duviing rmunkingmtt ond ‘beech
: fir ny ‘
oy re, alba te ddim iy pregrea™
nue fan
Now,
diiron 4n di
Diffeaunee bye Uinspit
[Hon Brae 08
4. the eLarertd 7 aviary
dn none Uriel ender
incon a
Linear DS
ander:
2 Stnple +0 Gop ret complix 0 _imphirart
38> Pn bes © ex
Stk 9 Que due 4 groph
3
fomeT Arra
y
Deo. Hy RL pa
1 Gt supruaut pavtolly % — Arnay = . ‘ sedi
ayy of a or ote bartels GS "1" An onnay ip collation af etinu) aed
feof o> Binutlon date type,
toellae- > oe. Be git 4
‘ > fn are contend only
oo a oR’ .
=< date wien ts calletion 0 f fintte out of dos
= ctony cor Storud ads
+ |e Zt colt bs suduad 5
b= (for ond thin data
—s nunory Aoccttion -
OTRO type cro norm (wruy
et Fea ant aliol
oe
oF Reyprumintatton’ I 10, 2, 80, 495°
nn © 1
* 3 (alas Joel cafe]
os. agi etl a CS TI
ots 3 . :
band Gee etsmunts coh dx subruitd a
CD Wlorud ny efficiontty engegauncial enganisate
Oe cutth thr Alp of ind on memory locations -
CS aD AML th elemints we ptorud at contincaus muro,
~~» —_focation
OP Bisaduartayre 3
ine oh . .
Se ch) Lrauhian and diets itetion of elimina Je compliioh
ir fol not. - 4
aL dus 0 sequin ch n ‘
ole Gi for proning th date large continsous fore
a i a : ve
ec beock of munory ub su guiud iacd Memory str anne PN
thy eleminté stemdomby|»
THypes_of aroay »
Li dimengieol
qd
O Mutt Dirameinod +
Rew rrecysue_omd—bo
Row aa por ond @foum
calcubation of an ovvioy sphifin a uci AD
covray jstosud 47 computers mamory ott pe
elinu nf y ones ye Borud at ty Buccerns
memory Location Pro thas location of elenrnd
J8 pute on Lypi suprupevintion, S
f «
Roce major epruuntation ©
f + ©
Ors Ormungional woOy p> 5 ‘e
v Orn arricy 4 Om ps
in cohich amlyy om qeubsorupe spucifitatton Je nesdd
to ppieity a porvercuterr elimrent by fs me ee
wViey aca EIERCE ad Ye eae ie
delle type- yoruiobls nome -Cauicociiet J
pe swt eats ob fn felts 9 8
Pera R
hy elon 29,167) E.
aGy je ee 4 : qsiosud an Hy wer
eciy| 2 | @mest be om side vous,
ate [+
ars] ] s
og) l¢% ; a eyamd kp the, andut of ebmunle
may alel> 5, 4, [0] yensurk pep ab”
oct 2 ys 5 1
i Fa Net Fr pak
Fe] EK eh Coemty bones | 2
i] Tene
gS at i
Sal id eer ia
Ao 4 position ab cahetls mugs.
et U8 tresiled
O Frbialien He vals of ¢ (tim ten]
4 Repeat mC * lea down-to pos
pepe fu rel down te £ poser)
Be ec] - aTeng
Pind fe loop
de [Tnert at tu verudable poaction)
pit o [pas = num,
9 [Remit bin Jt tem = tent
$ Dirploy ty rae lbt Y arront a
fra
accomdate
yo
1 ibis Rlbane We
Sadition >
Deldion ab dupiyud
p Oubeed Fe] iat
Te xs poston -|
position Tali]
Afder detation TST
— 4
54H ote tande
Or vpeutond
Cy
Roa:
is Deploy aM the eliment CI ovrrieey.
Asay >
of tuw eta to
+ ron combining
ferro neaw annoy
Simpl way of moging dtu a cys 5B
oh ebirunteavioy 20 [oT [ye]
il a 8
Dota typ vanish "Pow Colourn
tion of 20 arr
oe te
fenunted £2 a prio wanury J
On in plumuatabion >
Gs Row pray
elrmurta of over aru Steed fir FOU ¢
; J
© feutly” He comelte elsmente of poot-norg »
5 ptorud tn ad thin Aha Conmplize ;
Yeeond sme $6 Atorud ond BO on.Where
Ascray ts tn fom of 20m] OY
Lee
B=! of scovotd colsming
Zo Unt EIET = fee, re, tof na gina foal iy aaa
Be 108, i
i 8+ fenag
aly add: ef euinys yo2doeo +9
anaes
= 109
i a 34
Qe A 2d cavray 48 defined io lt, pol bt
few bytes of stotoy Bpare cach Kesh fu any
Cfo tn Puc rasiar, farne\ Pee ie ae
asta) f Bebtitnr ali Poparions! ale, by 4) 1
Bp 13 Lee -
fel" B=lo0
a, Nie Dhuy tes
Lowy bownd 4 areey Rots Ly 9
howto codumn ty 4
upp bound af cee Oy
PY Sa 4, cofuite egies
Sfe en a saga Aennk y= 6
Colbinn Fee
ine, Page et p
~ Shy
nS© ALtee -- toy ere = ass)
a) GA= 190 Re eee
~ foot pees
PIG] =? ~ 204
NO< Qsot28eat
= se)
AGIGI- leee+[ C4 tve)x
> BA aC L-su)wNe + fe) Jee
= Jooo +[ C4 too) x Sl + (44050) Ju 2
= 105416
= jeee +4 +100) x20! +7250) Ix dr
bess (eZ
ay Ie GO
Qian 20 artoy p Feo! 102,51 Se | +
find th addun of emt A [95097] <1
congicining “HY bod add Bp.jo , Gact, Clare
suyeurd 4G bite for storage:
MONOnnan
NE= So 457)
= $6
A[89,99)~ (0+ Fe agztoe)x S6t (194 3Ie4
= Yyeor
Pe
ans Tie
0 ; mf, Fo] Rew major
Ge ta
gee lee”
a Cio, iel= 2Colurrn neopor rd»
Moncory allocatton 16
done JR by column by Cotwmn Le faut Hes
clmunte af complete fivnt column 18 gfontd
n Gomeicte eo limunte of complete setord
ak te wtoud f£ yo ou:
Rrecin pl.
ae ° 5 ue Abbe
ACSI) = #foo 01 or 08
os ct Le Fe
‘ara eRe See eae
EGale) OUR tag 9 Gk a
Off sil 1 Reas by calm Cotes (Rew
oA TUG] = BAM (F-49104 Ie
Ly loust bound of Col:
by + lowes Kare
or
lec PUAITK] = eat [ rm Cit)
G-U] en
raz Total no: of range -
de. Sang poof fhe clarrint -
~ colpmn 1g ie dit elinurt”uppose Base [Aprils goo 4 Ned mumary
| for PAR: Find th eddoued of ABA TID,
AAAC SS]
|e
leuwitound )
ate cauparc Limet
posetele onype
¢.
Ce AY
ay dina div yotus 4 orviog «
PCI = FO Cares]
sy 9 hows only oddnus ‘
vomelae /
da
“> Ky 2 phone
-
ran a tae a sa pop eae
ba nae 7 + [P+ o) = OL] Rte
es Pe pti) 9% POI~Ie
ae Ato— toll
s a lexi] = dove
cB (paa12 Ath Moth
«
© S ppaiication 4 Annayass
« { a
Qudei tet ee i
a @ Ti\ con be Supruaintel ening 0
Wg Hi onder Loot ta usgal gor potynonial dup!
SR addtion + multiatiatin af tas potynondale:
=
Le cd) me avays £ on ako au for
S Te Vert pegeemcial cata Jatructun:
© 2d) Asviays wu und fo Sepeasee @
ae spe fAcut ru tes & thre Dr44
el ; ; ;
OS paki ah Hout medrur which 4
e&
sail
ss2
A frnoy (MXP) [Iooxte) fre fo elamat ©
Pew. Accening thy Jo ebnart Ons
° fins gican, Alaa only 12»
ith now zor elinuntd ¢
a a matoux cut be filed
ls
cwwth
Tp of
{ Lt ae bans cally tuo
ypu.
Ovpavr ae pet ipoibe matruren
A mato J4 paid. $0 be Papanae ruedouie, He
non Zwr0e elinunts poy four orhy in $he Uppy
Pregl of the notrin Prilebling ths gual dignals
ayAo tal nom} 30098 ey €
for Ges jem
6
°
a
2
3
2.
S
6
7
© Frasntion of elurust ‘a’ ot it desizud positten
ea an Msl
NK erst j
Lint bet = :
A Unk Leb 4a oo aut of rvodeA
a Jo 1c, @pictad ate Aom data eH
— elements Lin tere : cm Btw -
omy, ST Logical ondvury 416 sepruninted by basing
Mee cork elrmint potting to tu not efrmuiat |
and euch
Spach elemint i colld nods
tovoficlds dole field » Tectia arom
or
to ont
=.
~—
Me wd fou
WR passe Ads Curl, Painter
-. uae fret (yen ae 7
=e 0 Poirier
= oR Linte fics un £0 Rotnt +o
. part prode ond pfou te adduse net
a pode Boically, Vink field tp nuathing bul
S adds ently.
Pw Dota fields
= : The date field atou, acktal
Sp ple of an formation:
>
a. 3 Stott of Node 24
.»
a i
3 (ra Tost |
a) at, ‘S
= Info Fi painter
. 7
eer iyi) 2m, 2° (te
o
1] Ae
24
CNG
gi
3
aRSE nee
~ oink Lat 3
ly nomm'c deter ptrurtwu,
my wbiulizaHen|: (one
L Dutton wu coder omnalelpelet
plier ap pueoutor, cer by eaviily
caved out auth thb ‘ance ay
Dysadvertays of Dink, Lata, 4
15.0 sem Porth menor DH He no: <4.)
field | gree ene
a
9. AcuM +O entry Deva [Pomel 9
ict byt complve omd olso He
congurny|-
Link pt terrmraloyy =
O) Deter pela
Gi) Padus field (unk preta]
di) Null porters Te tink, freed) of As
dort pode contains nul sat hon
nyelid oddum Dp, indented th end af
dhe sist Go thot se Ja calld mutt pointes
pee Painter 4 pointer a
fiok pode in He Hinte List» FP
arotkle “fo ates tw entisn Bink Oh
bai eee
a
@
conaie baying of 0b) Bide rat:
: YO tink Uiet-
) pt she opel pied poultion din tte Ohkid ©
4 Hor Ut vo teelf) empty) tne
yw node snevited 04 Hu firs
ony Tia paver te ust toy
n stem pum othe Link deb:
rely bt difeted on
ti) PA the bugging of Link Lbe:
of & Bank Let: !
th apalied | positon an He
k Wd a
ea Et oi
tH Broan op ne pooust of gery
Heuauyh alt the ned pi tu pedis of
gink List pum ot Into Hse atwr end:
by Guword the tat node a
Stat ‘
ee ‘
Je(ward droultly, ansteh) mLorna
problem
Idler 4 mode eal
(Sy Hie typel od
Unkra Liat only ema pesht CE ley
pois fe pact Olarust ad He 6
{ Qe Veindedon “‘meane dthat . He dost &
nod, Link fia paid do the pnt
wi sede! fimd node. | tart piodas'é fies
point fo th fics:
by >
Heel
Find an
hand
: Line MOF OA Liat Je tlt
( bicews euch ned fod tuo inten &
—" I a acirceunloin Linke Liat Ba) Amy
oHNt | odds -of dH) way pat pode. &
pink Lield of stu , tout ned
LaLa Hel iy
Cede ‘dewbily Dink Dates 13) 1)
‘ Lh cht, fa
ch hos both Hu susan nevt pointer
Kea MU ved palnken Yin oiculer
SLOP ah 0 five shea
4) unk bet=
\ fu tink bet sa caltatn|®) Poviety Ys tolucten &
e notes & each node a wirv'lion 49 pt Of cate.
houing ond data dst leliment. Th arrays dne
put Unk pid deter Je alrvnys prot!
gtr atTeta09 ATH) ©
MM hi. | KaThe element Com’ be eocoyend
unin BOHN retin! fig a
fidd ob ualmy §
Oh clamunt com be eae
aeeses uring nent unk,
did
He \ ;
® one field 10 sueqeuisied
to atore pruviewt Link,
Hiner nods take) neor!
reanwerty. i ‘\
) Aden peru efficient
4o aces fo, etamunt’
@ Ne et etra field 58
Sagat unc podes
€am taku Lua muna»
ws deficient wecren
to elemig
Couetten af Dbl =)
pe tinvtodbine | verivviodle Pay = Tun. (Th piriebar
Hilp | flog 48 for roby cochuuh er
I as Dale Neb doubvew)
i Ia : Now fleiy = fab ‘i
ae Pte Curohing fork node Suet ad f
oundte « Link Lit By
hoe Suppose nu. womt so tn
yolug 2° :
Sp fd ben
dette feats Taal
Hep areL|prueer to atlo cation:
2. Punrcorny etn ki piblocal
08 PET seeped merce"
his effroest |9. Tt va mose ofpuat
ction don oh
Ontloce @ Colt @suttor
Mattar 4
> mobloc func® 39 ws’ fo ebloceke.
Hy rasmoy Ypart Al post sug uinnek:matec £ Caltoc fuenchin #0 ru Bir
co loen pot Crpe In urea,
£ block +h extehd , new bok I
a function fe und +o catlocute
df menarny.
# Cattoc
Ccathae C)
4 caktocey vtanas for
chanctet altocatton:
takes four
aseguny ty those Ch no.
beats Fypcgen! bless
&. yore dyrtay of cabloc CI
ee Csixe
allocate n kates of minory
is 4h cullorction wucetd a a a ay ae Eevo] pst plat
qeeond poly nomiad Qo:
porutée of kevond
+ pty (4p) te struvite fue pelyrar
expontnts cu egucd thin add the
$ storu end Jn the suaultont
Fi
rial P< exp{g thn atld coffer tex
susultemt Link Met ond rout
on g 4 point met pode Dr Vewod
poly nortat- é
GF ep: Ap) exp 4(@) thaw add p fen tn '
ont Linke Liat! end Sncwor
IIE PI SPC PSS S
a
a
a
a
bent
&
*
o
.
«
*
Le
5
>
«
<pe 3x85 cat ont, gat
q= py en evans (
"1 gory aaa, | |
Poppi BL Gey
@ Com fart ekp of + erpo. 4 GI
C7 cnateg uct) [al cnet eget
thon brggn pety prepe 1G oddid Py finol |
@ nour meet node —
Com port enps G) 40 emp (G)
£=6 2 pot ai eounh
© 4>4 C digger poly evp: 1A odded tm Ge}
sty
y
Riauttart |pt field dejo Mean dhat Hu @
ped oma Bore
The about fig. sndicater Cp 0,6) fr dna at
guilt com de build - ha| Acluomtagis af gente as Link, eat?
joma hid. 7
@ fox suprusenting the bist of
i Dee? He
may contain tht mutt pr sublet eu
we of ginifes Dink tet #36 Hu efpuent
7 AB angly ink, Met, dobibl, bo. on te
hot. effiuens waye. far rdf
Tha SA eee petpouianirg varyeus
perotions 6m multi yarvoku polynoniet
peuas Hu efiling of Hrs olgolet