You are on page 1of 8

hakur College of Scienceand commerCC

Poge tU
CE -1
Sjet Data Shructure
Date
TL
Name Craurav Kkairnar
Roll N- 20491 Div-B CSYLT)

.ExplaiD about he coOCePt oF COpleu


D data sucture.

T h e Compleu oP ao algoctbm is a kunttioO


describing the eLicienco the algocithm
in tecms ef the amount ok olala thee
aAgorithm must pOLC IS
here are tOO maio Com pleu meas ure
o Ehe eliciency o_anelgenknm
Time CoDpleajy i- Time Complexi y
IS a uotion destibinq the amounbE E
ime an alg6hmtake iD terms OF
he amou Ot oPOpu to the algohm.
Time CaO medn the numbeof me-
OmeyaLle sSe perfor meo the_ Dumber
o Etomparison behoeeD integes the
pumber_ of hmes Sonme nnd locp is
eAe CUted,a Same okten Aatural unut
Telated to he omoMt o recu hme
the
elgor ithm. 0il faKe

b) Spaee Compleiy 6pace_Caplexty


13 a yDctio O destribing tncamo Un
oF EFAe af meomery (spaceaD difo
ith takes. in Lerms of h e aM u t
o input to the algocith Oe_0Pheo-
Page to
Dat

5peak of" exra meomery needeolDot


Counbng the meomery eeded to Store
the dp ut itsel hgso ce gsc naura
C i s to measure fis: l e can uSe
bytesbut it'S ea sier to deL S 0u
ber Of integers UseoDumber ia
312e SruCture e 10 Ene end he
LuncioD eUe come up noill be
iOdpeNdeE ok_the aeuanumber
2 Explaioabaut- the Co0cePt oE stahic
along coitb uR algocithm o push L
Pop )empC 2 ().
A sbae js ao 'abshaek Dat q ypc
CADT) CommaAy used in most_poiTA-
fDmin anfuapel Is S 0ames ta
o E behäre ice a real cdodd Sack
ofor exam ple a decc oK Care ar apile
plates ek
H eca coolo St a S Operaho-
n a t poe enc ow .fLon example
e e coan ploee on eremoe aCand
o plate Lrom the op o he
stoLe dul Tus Peatue make iE
LLLO catasuetu e , LLLO Shanols (or
Lastà0-LidOut
S1ackoperaion may iniol vt iuti-
ouliin tne sta/ Usid t ad e n
ole -iniHaliing it Apor Ln M tcec
baiic suËs a 'SLaek is Jses ec
Lelleerg pnmay apeèatiou
Pusb t) - PustingSroring so ele
Meut

fof C KemeuangacceSirna)an
l em e u

fuuuO-cloe i batk is

e
PageNo.
Dnto

3 Exploun abouut the olouble anol Cirtu


liwked sE
)Doubly liuked i t
Do uby Like Cit isa vanatie
linke u t io colith noviq atid
possible in botn co ejt Le-
cOcn and baclloooeeosi a Comp
ared to singde Cukes UStO obuOin
under -
fue o.ncept OY olouo b liwes
sb
i) iul -Ecel Uu a a liwkec isE
Can stoce a data called an e lemeut
NestEachLins of a linked fist Coni
oun a liuk_fo fhe Oent_ liuuk calle

ii Vre Ea af iw 1ís
9taind o iwk a tae peiouA iuk
( l e e pe
i uked List A Liuked List Cavti
h
e e csanec tio0 liuk to t e f i s t l i k
caulled i s t ane to the lat liws
O ee L a t

Double Uuk preseuaion i


head
PrerData Nent
Page No
Date

in)_Circlyar linked list


Circuar liukec i s t i a variaion
Uuked list 0 th fhe GgE eleme
At_poiuts Fo tne Aoxt eksneLt_and ne
eemeut poiwk to he (üsttelemet
Botb Singty uuked an DiubL liukes
lis can be made nto a cindilan
liukac s
A)Singly Linked List al Circular
Lsingly linkec ist the neat_20iuke
e astNode_pojws to the int node
Node Nod Nod
Hea Data Hems NeRtL Dak ikyfNontDaaieny|Ner

B)Douply Liukel Lit


10dubly iuked lit athe Dneat poidt
of tha lastoode peius to the s t nede
and ne preisu) Poiutecf tte (irst
e l e poius o t e \ab nede makiu
e Ciccar i0 batn oueckiory
IHeadPr A/Next PewB Nestbru|CNeyE\
Paga o
Date

Basi 0peratio
d i 05 ect inserts
tne
a elemeuut at
sLart of iSt
idel'e ele bs an
elemeut ao
Le slart o 1St
ivdis2laq Ois play e list
4Wha sSo
Sorting Lploin about a
f mefue o
Sortif
0rting The
9eo-A arrangemeut of
a-
data o a prePfere) Orderis Calle
Sortinq i0the lata ghsu ctureBy SorHns
olata, iLis easie o
'
Seatchthougt
quCCly and easi The Simu lesE
CNample of Sortin P
a dictio Oor
B) Metheeds of Sort
i) Mecgc Soft - Tuis algentnm c0or
00 spting aO uD halue
Oey u o
Comparable si2e) to nall is e
Socl eol n o mese dbouc
ogee b
ia e merge ) ugdio

Here's hhoo he olgo th.mcoowlO-


lerseSort (am] r)_
i

Diviode the omey iuo eua alue


ocatig mielddde poiut

iddle m= (1tr)l2

Use hemete Sort Puoho h cau


the Seno (idt ha
Cau nerg eSort (ass.I9)
,

CaU mergeSert Por fhe Seccndtrejlt


3
Ca mergeSort (ass t l , r )

9 Use thc mege ) Vun c0 erge


fe hu nalasertcd i shp 2 4?

Ca mege(am,l, M )

3electio ) So 1 o tisSoct
the Sroalet eeneut SSeuFo
e ucst posiiso h e o n e t Small-
et elermeut Sear ec te
esmaung
Le Se eono\ e D
uunl e e gciho teacbe e
4una and oloee it 0 gth pesi non

You might also like