0 évaluation0% ont trouvé ce document utile (0 vote) 51 vues18 pagesDs Using CPP
Data structure using c plus plus programming language in this pdf i have provide you my written notes that i made in the live lacture
Copyright
© © All Rights Reserved
Formats disponibles
Téléchargez aux formats PDF ou lisez en ligne sur Scribd
) classmate
Data __Shustume ts _q__positfeutar wo of storing
and exganiging: data %m_ he. memery- of the
Compuke so nak nese data can easily be
accessed and offfcieutly: used _tn_the Gudone when
acequived _
‘The dota can be managed fn__Nasious ws
Mike ye logical ex mathemabcol ynodel fer a
t -Specitic oxcganizaken of data js known a
| dake structure
+e | wonot ts data 2
=| Data %s a callecton of facts and Aqures
7 i
eres ed fa a __ specific format fo smoke
@. Dake comes in the form of lekteis qumbeis cy
j
| nso sek
© we can represent Hoe _data inthe form
_ | fete, qyropln oy towb\e ete.
@i The dot depends on the sources to be
| cedlecked.
_ @)_ dota %s based on ghsuwattons and xeesrds and
As stored 8o_ cornputen aed yernembered,classmate
Dara contains unprocessed yor factors .
Wihak ts fofermation ?
Tn formation is -q data Weak bas been processed
and _evaaniged to _ add ensanings and values,
@_ Toformaton js a Pe farm _of ideas
i
|
@ we can _vepreseat Pre Anforrmabion ia te fern
| of languages and — Prowynts
1 wd §
|
| Anformakon depends on -Pne _ daker
1
|
@_|_Awnformation 3s __enane _yebiable as cempared
yo data and tt enables _yestarchurs jo conderer
peng study
Tne _Infermalion % processed 4 a mea niagfarl
wor.
vClassification of Data Spuchune
SS ee [para SPuctune|
a ro] Pkmiive a Nen= Pxmiive
| > fot
fF choy Lineas Non-lineot
[~? foot ———_ > Tree
> Double, Static | [Ldyunamic Ls tvagh
Preroy. Queye
: [> Steck
Linked Uist
ae || Linea dota Shurtune $- Deka Stuntune fa which
doka _hement$ are arranged sequenhally ov line:
| whee each elemenk is aktaahed to ks _ mevious
7 £
| nd__nexk ad jacork ements | js called 4 ineas
data struskune.
|
© Shakic dota Stuichie S$ Stabe data shuctune
has a tixed memory sige Te is easier
| x0 cess aye elements to otyc ch
| Sree, Se. Aw y etc.
© Dynamic dota srustuye $- Th the clunamic dato
KAS ne Nee Xs not Fixed - Ty can be
ea randomly. supdated dumng Hye untime
GK. Quews stack (inked lists
HE || Non-Lincoy data Strustune i= Data shructunes whene af
Adora _eremets are __not _placed que oe £
Noses are cated non- Vineo data strrtuses.classonte,
we cant traverse — ath ~Whe
o_single sun only gy Cavaph pete.
HL Wher %s Abstract data sype?
|
|
2 |_Te abstract _daletype is _special type of
i datakyoe nose belyevioun is defined by 4
t ek of nalues and sek of openations,
| The apt ts made of wit _ imi bive data~
a Mapes. kr opamaboMs logics are {iden .
d ADT caly meations wha _eperattons are.
to be panfeymed but mot how these.
u epexations A\\ be frnplamneuted .
| a Fitaterco
pbshack para “Thee
+ ea re oe
| Agorication Tneface | Public eo nate tunchons | \
Pape 7 i [— a
fl Pola” Srurhne S
1 poraa Unted sist
I
j
! Set a || || IF |
~— e eT |
Hi Types of AOTi-
Queue ADT
@_ poy pot @ stack APT _@)_ ak Mee BOT| classmate
ee
2 Dele struttune optrations _are_-the methods ased
“o__reavigulate tne dete tn data Sburtuse , The
smast common data shutune openations one
|
____@||_ Traversar 3- Traversal openattons ont used to visite
r ¢
ae 1 Gach ede fn _deka _shustune ‘in a specie ovdey,
|
: 1 ‘This operation 4 gqencually used for searching _
cis (losging _G _veadhing. Wine _date._stord in Syne.
| Straetusae :
@IL Ansestion 2- “Insextion opemabons adds new data ehemert
l bo a data shuchuw Xou_can de his ar ne
data PUSH O'S beg ginning middie or end
Deleon §- Deletion operation fo sA ts used to
ramae dota Nemnenks -from a dake Strurituue,
@_|_seomeh :- Seasith opeuations are _used_ts Sind | a
| apecitic dota element 4 dota Shusune, This
openadion As gered used to fompone, wo dasa
eras? fo dare Strastuse
|
@®)_ Sort .- sort OpUralions ant used kv arrange Mae
Aoda cher WKS. % a data Shustune in ao
gecihic order. eg, bubble _sovt, mange sort ete.
©
Mouge So Mew op enaly ons at used +o combine two
Boke Shwe fat one
|_|
)_Copy t= Copy. _opemations are _used to create _a_dusplicalt
| os
a dala Strouse.kof
— | —a__pasblem __ox
corgi ¢tins ask. Ty ts a
well- deQned —inshuttions fac performing.
calulatioas ov other groblenn — solving opeHasyons .
ee A\gestben ts a skep—by = site process for Salving
e Seloxising of Algancinrm en
Zo
sg
utes to thsi
ected _coatpuste | output
| apa
“feo tna git |
SN tage
A\govth no
=. Algaxsthen __fo\lovs ological Stuchute $=
I
© | Sept = “The _algerithen veeeives ingus dose.
2 | Processing 3< Te algestnm performs a series -of
epenadions oc “tne _\nqust clade
© | output i= The algevthm produces ne _desived output,
+
a *clessmate
Date
Pese.
| Arroyo C++
is a data Stradune nat “is
Used 7 nuibige vatues of similan _ dara
_ AYPes fa a continuous enema, location “En
Array indexing ef dala eleneuts —_stesits “Gorn
v
Oe 8 end ot A= lene om fs ne size
i Arey
| peta —> [10 [20] 30] 40 | 50 60]
| Index 5 06142 3 4 5
| ;
a Properties oF asmoy i=
0
|
®| Dlements of ourer can Ine _acce: sed using thei:
Sadices :
@_on ; i ;
V Once an amay ts dheclared ih: ize seereins
€
Cousteut -toxougreud -Hne_ornerern
®! aa oretay. can be hove _mutiigle dimension
| Types of free
@| Single = dimensional Ar Single __diicnensional on
also known aS a one - dimensional eae fs a Vineas
aro -Hhak stores lemencks of Ye same data
asyce Aa aN He. waslable name.
ey Anithadige & isploaging ald Yne elerntats of Brocons “a=classmate
fot_moain OF
Ant__awr (8) = § 410,0,90,5,3045 I taking & \eibahiye on
[1 dispensing, ALL the chements of otouy
fey (go 4205445 5 44408
cout << ayrT i] <« end
By
4
Rowe tr 10
io
|__20
ios
| 30
[
ae Tn sb values in Avro 1 =
d
! fat mein OF
| fnr a TH) S
| fox Cint i=05 ices 5 itt) §
nor afils
! i
ab
Seoxching- an__elemeact 8 ag a
Sok enain (VE
fot a CFV = Qa ses oad;
Aor (int 420 5 42305 i44)
ee | eeclassmate
i Cacij==6) §
Couk <<" element Sound" 5 4
ese §
Couk <<"
~
not _-found "33
ss | Cokadledienge ne addsess of any clernetd §q_ the
| at 2.
! o oun
H
choke MN fer yee EW [i Te a Tie in pe —|
7
| de sO” rT 2 3 @ Ss 7 8 J
oddrers 3(.000) => ex)
all Formula %— Base Addyess + Sige of elemet (index)
i
I 22000 + 4+ (8) c
| DS __ 2000 +32,
I 2 2032.(yy tae
a,
Muli airnen sinned — AS
Mulsiainene
CSS ee
| -
° a: .
[a monk Sonal or: ee
: Lie _-Khan one cienengpo te is Hae _hemo=
| alemms SHEE Cady,
|= 920) colleckon of
v mubsigle indice
Cox s si
I Sx canbe 4090 Qunendgonal ov Het
: |__chicnemdonat_, ‘The date is grored in “Yebullont
L Pores Cx @ cslums) _weido te abso “evens 6
/ | woed x4 : : “
|
2-0 Davey
—2= Drnensionad array ts the _shenglest form of
a _muttidimensional _otvrcnt= Ty is a collection
[of clement: or ganiged in ow _anad columns.
Te can we Visuolized as a _teble or gad
rene Cock elements 9s accessed _asiage 4450
| Sindices one for Ane you and etnen fear ne
| eplucnn.
i coluenn O Junin fe column 2
ext | Row © x Coie) xt) x CALI
j
| Row 1 Gf) xe C09 «(9
Row 2 C23 Ce) x {9 05 x fe) (5)
A Tritialigaton of 9-0 Avro
v
os Syne. “et dotats pe. Sersde4 game Crew) Leolumn) *
e =e) fecdr__asani 215
L u 7 (¢
domtgpe Ey [ak
‘°classmate.
® Rew—-majoy 2=
tr s
“ne yo9o- wise sorrangerneuct
of she
elements of
Q=) ose
“t nw
2B Cir {20 > dees Get) S Oo 01" 02
! Cot j20 4. j-2) §
cout ce" Slack undenfles” 34
else £
- couk ce" DISS dunenT i 4< stack Lisp] j
>
ee
4
: 5
©__ PeekOr- The epuaSeO in Steck 4s used to Bisley
ot__+re mest Sement of te Stark .
2 | eid peek OF
__| if (top ==-¥
| couk <<* Stack uodustion" 4
erse
cout << Stack Loe):
sass \ Sita atin \ |__openation io stack. is used te
elerneuts of Une Stack.
2 |_ noid display OE
3£ Ctop==-a) f
Gout 4<" Stack is _eyaptye
cise §
for Cint i=0 5 ic= top sit) §
Cour <4 "Stack element tc " || Base condition = The bs coudition is. & cowcdition
“nat fs used 4o -fesminake Wye -recusssion . Tn:
weowsive function wil _keee calling: ivself RN) he
base cowbition is sak'stied
Types of Reuss} on
@ | Direct Recunsion — Tn creck yeeusision “the tun dvon,
awit calls ‘sey _ome oy _woome Mime. ‘Thent is mo
- Sahm medoakt funcaGd £
it (x==0) £
break 5
4
else §
pre (x)
ote x t=
mMeEx-1;
AOD;
4
| Trsdivect Qesassion i= Tn Indaverh eusssion The fiochon
clo€s net _cails UsdJ. _divectty but Snstead
Ak calls omotnen function Son Yn eNurine Woy
cals tne Fivsk function creat ng soysle of
Luocton _caths
AY
Gase condition
BO)
+4
Bos
Gase coudityon)
AOS
4
i oaclassmate
Foil Reawsion $- Te is a yeurswe function in which
ine reounsive call is he last slalement Haale ij
excusted
Nee +o.
Mne functon . Se basicaly Kowing is
execute after ne _-retusision cal. ‘Nerd fun Cut o)
ra
At Case)
y
£
pe coud Removes & selunns the element Som the
I Sout of ne quanas
@ | eck t= Ruins Ye ewer at Ge fuk q ane
| queer.
_@& eee Gneeks UE Ve. Queue fs enop hay
© _|| Foss Checks if Me quene is fut.
Vous aimerez peut-être aussi