Dat Astruc T 08976
Dat Astruc T 08976
| (oe = —
Example : Ya | +
Pass 1: l G6 4% 36 24 qr BS - 22 :
Pass 2: Il 24 43% 36 Sh 9] 8s 32
oo ere ]
|
ee
FEE — if. =
IT
©non — homogenous dala ¢ Glructuges: 1
i Home nus Gdaod
e fi
~ => Tn" hum i dala olgactuse, all_{he Element bat
i Lof Same type Example a fgay Tn ben — |hen €0us ——
- , :
I
it 2 | Define abelaack gn Ayes
T= he abstract data wd ¢ , Samebimes abbieyioted “ADT
how we Uitw Lhe -
oc ical descipli Len of
EE 15a
opens Hat are allowed +
= do ta ofl het
_ Lo _ Teqard how they will he implemented = -
without
- i Thi < . Mean g Te we aie - concened © only with =.
4 ge. olga 3
"oes 5 ics This is oll
of abstract data Age fC ——
he
hiding + SiSome _ Cotariples =
Tot, ets ol tev et
+ Stuck+ Queue
ERT ro
pe Er) = ==
bioked [1st wig, 144
_ ANT lneay
Implementotion: i
Collection of dala
Ase Llements which,
Called ‘nodes! -~The el | —
ke ements Loy. ob Moy
Stored1,0 Lonsecutive me pop
— Pointess mory locations, so
aye yged maintain lineas
— hode “18 divided _i oodesEe Sls i
nlo two padls_-
—_ pas ___%oale freee
Contain dhe infosmation el th
— _Blement ——and e In
is © Called ‘“TNFO Field! + The’ Second |
A Contains - the oddiessofthe next “node [TC
and js Called CLTNK Field!
_
os ‘Negtt
t- Pointe | r=
a Te ___Stast Con tains
addr
andr. ess
Lhe 5 Eastin
RY: the. [i nked IY Je- it fotos iL|
address | of the fisst, nde of the inked 1pe
— ist: dx ihe! LIN k __Field : pf. . |ast, node: Conbains
Nor Value which indicates’ hel. st 5: the end
n= altos fet: «Fi
C — ple mentation
Lin
of ked [is Using Cit
| _
| As linked list
- _(apsist of ‘bodes we need dn declares
I JQ Structure which defines. q Single__node- Oud 5 truchee
fev ab. least one. vasiable for dota. sechioy and
a _.poiplex fur the next nede Tn (i "oud (de
—y sould look like ~~ this-
| Struct pede
HE
| int data : : i :
| node X peat : SE. :
dy |
| oe an argey— Fill Ihe
I
search (hygay A value 1)
| Lineat
Cet 140 1
|Sebe glen 1
Shep. 2: 1 i7zn thea Jqo do sie 3
== Then Je 10 step £
: 1b (5)
| | cle,d i Set 1 de 3bT
| Step § © Go to slepZ
element X found al index i aod Salo Sip 8
| sie © z piiot
Print element not Lund -
fi S¥p rh :
itp g ° Eail
41}
|
owe [J
1 ] ame]
a
ame
=
— nT tH tithm -
Ex th
sbin. SoikwotkswiSimi
hhsexbionnsea 0re The So
rting_ of
— —2 | ITn lar.
; playing Cards’ =rhi : CotLJ 15 = tii)
Assumed ha
[ | = cla
‘ FS
. a —
ns Hon lang b-
pe
Maorithe fog
[I
lo
|
Insertion Sart (argay) I~
_ mask fisot element as Sobed A
unsorted element A ) —
I Pox eqn
element x _ —
I 'eatiact The
-
&
| Date |
—_—
11 | Step x lS Start
Step 2 1 declare Qo and loft , igh [oid variable -
l siep 2 1 perform, meme uretion .
felt Z tight
Teluen
mid = (left + right) /2
meTge crt (aray ! left | oid
Meise Sort Laney mid +1, tight)
MET qC (ateay eft nd Tight )
: Step
= ———r—
|
= ——
dizad vente es
es and
_- and adapta
lin ked_ list 51 e
tS F efiae data a{paclue {hal Can
linked Via io Qa
—-— ILA
ynamic in
9 Tivey_ area a_d quite ed. : a
_ mem0l ag when nd deletion opesaticnd Con be easily
BE impemented-
an
RB) Ee be
BE ea sily Cxecaled -
weue (a n a
we Stolk and {he Qess Aime
.
154 feduces Lhe RB
3) | licked J
s o f T a |
5 | disa do
d ne ta ge
[| | patta
nterss fequite
memory 5 ‘wasted Gs poi
"Te —
elgfagt -
—
—
fet y 3 2TT
Can be accessed 1fabend
ee
J
i do_element i
mode equeatia
—
ee
Ar
00055 each in hiked tisk ————
H8auEINg a. "ithe
1) ReMese ———
|| = 1 EEE)
i8
| aed
4) | Nee of data Sleuchine. I ——-- i
ate wed in eves Pegler ot Soflwete of
a ala oA
°_ Qfdonge he date Sees _— pe
PE siem te
ase. easenkial In cients of mony =o
il Tha
Cw) ik dates
|
ee
dgesilbo—— 5 —
Space Complex by of an
5 ) |Ie
alqos] then =
ce Compleaity = of Qn" Ny
of Mem of Ipace zequised by the
in tiga is life a } gE.
algotithm 15 _equol
ack
two Components:
Tui,
tequired fostore
G Space
fied pa ab that je
and _ Fr {het Ofc a
Fa For @dampl®
_plablen
—_—
he Pr “the
s d . p r SE
ogl um :
of
and Co ns ta nt u |
| Simple vagiable ee
——
a
eke
yatia Hes
—
apited yo
I
JE em
0 gpace
vafio ble past 15 of the
jp on the Si
a)2C depends Sm
meMemmbly ETT
b __ ¢r am pl e . dynamic
pichlem: F o , Ea
im
lt Spate he, a
fecu p Si on $ l a c k
5 i
|
|
| pe]
He =
age No.
|
ft
-
——— "
a
TT A CRN LA Ait Fey
= ge. divesbiona] array.
1s G8 peectalized fam of
Te wd — dim
A ppc bog 0) ensional K ~Qtray
‘which - have | i disdsiag,_r
mult dimen Sion) Er
— :
AXfeyS___ |
LITE is oadely used a rong all pea ’
\
lw Wptesent_Qa malig Wo
]
al Structure.
a
K
a
si
{
| - BP SI PS —— = TT i)
\ — | Syolex _ a)
spe
en o. one
ott [rab 151 a. (sme. 2, | dimes PR
datatype
wn | nd asmepd Se Lo 13 trample
Nena — pa
_ 1 x i bi
= 8] |;Memory Spedaticn Cd ope EE
Tita) —
LO which -
dias aga at age lineat. ~peKey
— — Ore -
tn lhe Sucressive Ine mary ow
- elemeats. amp
at the very First’ positicn
i he cleat
ye
ta the ak js CCalled its base address
’
in a
+8 19s | 4s Te
| Element |[24 |
Todex larelo]-loo | an(il-7 lat?) 7 ae(s):7 | ase(4]-7
Data
he
a Tei Do
n Babble... Sotb._ with algorithm: rith
~ 13) Explai Sosting i algo m thet works =
— ||Bubble Soest is a.
Stepping thtough | ios thot need to
§ by ve peattdly
pai¢ of odjatent items: :
be Soted , Compatiog each
a
_ Swapping Ue if Lhey ate in lhe wrong
I
passing peoccdure is gepeated until
E—— ovder Tis
ase Toquited | b indicating Lat the fist
loo Swaps
Bubble Sort od ils hame because |
—_—— | 15 Sovted
elements bubble tooardy he top of the
Small
| liste The bubble Sogt algorithm Gao be
© inthe
PpiiRe— by placing - larger elements
| dial position. After every pass, all_elemen :
the last Swap are Socted ard do
after
need to be checked Ogain_, there by
not
the _ beacking of swapped variables.
Skipping
end fos ]
| b= n-1_
| ugh} nel Sessipped - oo
| end bubblesest:
[Define attay and ids pes
The QBtay Slofes 'Q Ei Pie =.5 ize Sequential Collection i
of. elements of the Some _lype-" MN) asrop comisg
of
i | Contigu tus emory _lotaliong + 1a address
(oes pond 5 to he fissh element ond the
h iqhest address to fe last element
// Cua mole :
leg
A |
1 Tin
rT
twa —q:
———r
_
—linked list ' and {iy
-
adua
it
{o
JE Li and L
—
TT dis, dugg a ey - J B
_ - _ —
5
N —
Tivo
— ~
way feb
—
Loked list to a vagialion of
—_ oh ed list jn which —
~hovitg alim ig possible in both —
|| As) eilher _— {oon Wl ond batkwazd ) Parsi. ag hae
f-Lompared 4p
— I im
Single Linked List
© Following” are the
ob lont
do Undessland _1he 7 tence it of ~
— 1 doubly | RE
— 0)
|l poTANtinterisoperthpuatousbiolegh fo jmplemea) t DLL | with
1
— |1)
FC
nen
—
N
oo i
Ct be _malptained-
=
— LL
(Paga No \ -—
on ]
I
| E. ——
; Space I Leith in ret
A “ime
| Time Compal ob an alaprithns _adusie we Ba
= [Time Com plexi of an” dlqenlhm Lhe [7
epgeseats
Beqpised_ by the algosithen to |
—
Xi =
a?
\ amount
tw. to Completion: |
Seg uitement = (an he define] _oneia Numerical | BE
E = dl Time
Tn) 0 whee Tn) Can he. measuzed as the |
§ function
eps weed each Step . (onsumes__m i
¥ | Numbez of
| Constont Hime x ; i ] Lt
, eid hind of dwo pn-bits inbeqei.s {uke ot
iar) | Fot~ example
lo Steos Then the total Computational time is ic
AT) = kop where (isl the time tuken fof |
| addition of Ywo bils- E
Asymplotic on gefers to “Gempyting the funding |
canst
Wn mathe molical © units - of | 3
Lime of operation
| Compudotion ‘ .
r
—&
=
ee The BAe
(Page No.
| Dato ]
Ne ———————
~~ Mdveatages of agmays
= i) LIE 1s Capa ble of stag a¥_Many elements at o time.
w) | Allows Fandom QcesSing of elements fee Ong element
Ry = Ihe Qesay can be tandanly Accessed using fodexces .
] |
| disaduanta es of _qaxgayS
9 | Pred lerm {ning the Si2e of fhe Q¥ray i5_ a must -
[4] 4 Mem ory Lostoe at 9 hogtage ;
i) The re is a chance
1
Top = Top +1 (insection) —
Top = Top = 1 (deletion) ‘
©@ | exit
flee
ni) | op = dep 41
wl | a [top] = item
v.] | vit
_Eyit
| €lee.
| Tl em za Phen |
| Cnd 7
iv toy = top -]
I El : le Eun;
Paga Ma.
Data
I
1a way of cellecling3 : }
J = opeza tions
uch a wa {het we fan neZfeem
msds Orga
lok Structure -
— iH ) = a? add A
line are
the dota lems
linear data shudoge
Is Segurnl€ Fok edamply e ore oy
In aa linea
hie ,_ the - data | lems
| T out "da och and =
fan las {ree s
In Seqye nes - Foz
{i ot -—
=
al
_—
[Page No. |
[oa la
EW irae -
Eomee
LA data Stiuctuse. 15
——Qnd Stor ng dota - Gear a atgihed 4p
_ Qe
the Second the
oe a
e
ile —
v
~ linea dala
i -
BL_jL
pate
.—
| — re
— 1 ==
— —— —
a 1) Tobin notation - — oo
we waite egpfesSion in infie polation -€y: a-b+c,
where opefloss are used in-between optrands <TR
js
i €asy fof “us humons lo fead ywiite | and Speak in
_ Linfiz_ nobetion bat the game does pot go well
Lwith Computing devices - An algesithe de pieces RET
——E— 1 notetion (ould he di Plieult and Costly in tems
of
| Yme ond Space Consumplion- :
t - 1 ~ -
Cm T I XI I
k 1.”
TN
to the -- operands ie ihe . Operalor’ is writin
| afer the Optzands . Fog example 1 abt « This 1s
equivalent do ibs iafix potato a tb
amd = —
Define queve: . ea
deletion
.
isa
f
lincas lisl cof Clements in which.
— [Queue I
one ed end called the
Can take place only “od
1
(an {fakes place . at a ~
8 {sont © and inde dlion
eas ~Queues ase also Called AA
othe ead : Called
out, Since the fires elements
ROS fresh a last
the iret elements in the 19
ta lhe Queue wilt
In olhes words, the ode
—.qQutue’ SHE feo "
in a queue is the
{ in which elements enler
_ a ¢:
OFdces in which deeds they leque - 4
x - el
eit
| i. ~g.4 2 & A
§ | EYE T.
T dlde<llolselzol C
I fone.
:
Deleliog {tom Lhe queue
2d BB
eB AE 5 5
Pat = 6eat—| —
= [10] 30] 20 _]
pe
=
I
—————
. | uese. ———
24) | Waite clgithe la _inseleo and ddelion__in_gq
—
—
1
| Tnsexlion In queue olor
Reqs = Reas+ 1
!
“8
-— I acl
Zs [ed of if
X |
+ Jed quede [ Res) = tue.
) Shep 3
) | spep 4 1 Eaik
I
~~
=
NE ont pf =
25 Ex Explain Typos. of qu al et gL IB
2) Cicadas queue ~
_— I The Q77q ngemenl of the elements Q [ce] g(1] BE ole
Ifl fa Q (ealar fashion with § bh) following al, n]
= J
13s Called Ci¥cglat Queue. J
— a
g => | Types af tree. LE
SDN
: i) | Geqegal dee a . ’
: F—~—
NS — Th ereta) tiee these is one moin foek 0 ad Seq,
Pp Number of child hots age nat fixed in Pach fe
_- level: ~—
ny
= ii) | Bina & tree. Ey
dl — Rinaty fiee is a Caco ination of one main gect dad =
Fs the pumbes of Child noles whee the pumbfy :
7 Chid notes is fred ie the numbet of chad
lpotes 1s net mote than two at each levels:
(Page No.
| Date
— :
|
—
Colleckion of Skates
finding a path (Ang -
Queue 15 hed {os
J
of Graphs swAT
breath - Coroh ~ 3ednch
Paga Mo.
[--
Data
rm p———r ==
| otep 2 Tf font
= -1 cod - Reat=-1
Set front = peax=0
| else
| et Reas = Rear + 1
(ed of i#]
ER
{sont z front +1
—
<
LL
(End of if |
Fn
Step 2: Ext
1
| = —. my ee res
eel I I
T JI —
) | Ciscalas queue
= | “The Q¥angemeat of the elements alo | q nm Gln iu]
Go a Credlar fashion wits €0) folowing Qf nl
is Called civcalas Queue. ¥
—> || The last node 1s ’ Connechel to fork wale to vl
make qa cigcle
— | Trdially Bath faont and yegs pointes, paints 1a
the. 5 inning of The ama . ta :
-
ol It is also Known ay
J
Ring
|
Buffer" -