basics
basics
Trupesh Patel -
LDRP ITR
CHAPTER I INTRoDUCTIoN
Veiniti&M
A_cdatu strueture is a Speeilined tsmat
Orgixiu pwcesiug redrieNiu uLe. stosiu dutu.
Basic eminele
ata Zatu CUeVeulues o set o Valus.
ZatuItem at item turs to Single unt ob. Values
Giroup Itms: Zrtu itms hut t divided iuto Su
ites re Culle, as Gjorup its.
tlmeutuy ttms etu itms Hhut Cannet be divided
C Calle as lMLtuy|tms
Entity An eutity 15Hhut which Coutu'n cetuil
atvibutes oY ppperties which ma be asipnes valus,
tielo lt is_aSingle elemeutu Uit einetmeti
epestina a cutoibute_o ce euity.
Recwr Keeme is a celleetid o_ gielel Vrulueso a
qive eukty.
Filefile is a Colleetidno hewtels o He euh'hes
IMC ive eutity Set..
Algeritnm
ovim isCL5tep-by-step p7rteelure Leuielu
dehiues Sete nstrueticns t be exeetee
Cdan Dhdur get he_clesineel_Output
Categories oalgoriHhms :
Seahch -Update
Sort - Delete
nst
Prof. Trupesh Patel - LDRP ITR
atcuStruetune
pimiivE_Dah stmtwris
Pimitve Dutu stmuetures_Cne Hhe hsit
Sfrutues HautdisectyapL2ate upon e madine
istctisMs
ELmples Tutys Elpuhi peiut numMbers , Chtr.aetr
Constuuts Strin4 Constuts Poiuturs,
aM_elunut n
DetidN_ melns_w gemove
he iven clcutu structwe
5iz
e?inpnt lutput i
pmblem Size coulel be o.
C _alyorithu
I Sewseing a e l u n f y an asauy
we ant
havin nelmuts,Hhe prehe SiLe s Same
Cs Ane humber_ef_elemuts n a n e tp
bu Semehe. H e the mblwn size cu
inpnSixe CUre the Same an_1's equd_to_n
Asumphm:
Thue _e C Stctmeuts nside
leup.
Foeh Sttemeuts teke ane
nit o ime
The csuphivms_Ce uele beeause inpimatid
he tget muline is hat_pMLdM when
te alsorim
i Sbuilt S i t i s et possible. to Sc hew muc
meech studtunet in he alaorith tkes to
eyeeute, The eyacthime
depnels n he uc'ne.
M_which e _cllorit î s un
As pe Hhe Prof. Trupesh Patel - LDRP ITR
asumphonMs
Tot time e exe.cutidm hr 4 Jwap = c¥1=c
Since Hhe loop is exerded ntimes.
Totcl time o exeeutisn = h ¥c
1h n*c is dejined_as he Onder o6 Magnituele
0 Algori. Sincecis a Constent oreder o maguitude[
is aoxivmute o be eeqU to n Tuis appai mah
3 beeausc t highe Velues n , the etheet ot
c is ho Squihicant 1hus constaut Can be
1moreo
Big-O_netuthim 0Notutin
Big o fers set e aukunchinswhese
Vcuteis_wighu han_Hhut o He_culgorimm's
gowth_ake
Tis Ca be use npresent hirst Case
OWnaL Case or butCase Condihns_ak
algorihm
fn) =qF boune of tt
algoritym
Mo 1
Pr Size-
Thrsheld (rwH e
Size Cye)
mequhotutioM _Notutie
l t epresents the ewe bouna kr time_ek executidn ob
CAM algorithm
Omega yefes_t Set e_alkuehisns es12et
Yute lous Hhay hat o_the aulaorithm's
t yure
The bat_Casruwní timeo_ay caaoritmm is
detninee wh he alyoitha hus the bet
20%iH Loeib eyeeu M._
Prof. Trupesh Patel - LDRP ITR
g nleg
1 1
4 4
2 16 16
4 64 S12 2S6
1664 2S64016 6SS36
S 32 16 104 13276r|42141472961
FunctiM Values.
Prof. Trupesh Patel - LDRP ITR
SO
3o
10
-l05
O 1 S 10
riut 2
Prof. Trupesh Patel - LDRP ITR
So As lep itexutestiu is EM
fn)=
O (fe): 0CM)
2 i:1t y_do
fay k EJ+1 tp n eo