446DS UNIT-II Notes
446DS UNIT-II Notes
a vup objeet.
ollue. whese k
i a colleckiano paikp he fosn (5,v)
A A diiondey
Value asousde i he ley
V i he
he tey md
haue t h e
eme Le
dicioan
ND two naic in a
drfeient presGm
aleo callad hov,map
xA deAlon any
numbeu
hudent se cor d epeleayed as a didonan oith roll
Exomple
nomes
aValue
eir
Cnd
pe cdhon
iintest(t,v)
.he dAjomon
tert he po
Seach(k)
) wh the iva y
-etunt he yalue caled
it) delese tk)
- dolelel he a th Ve
ze )
seturn he uo. of pau in the d'ckinGy
pemelaton P Detionrea
oskin
in ec i Peprelenlaho
on)
o (o) o Cn)
o)
(n)
Soled
DCn)
Uniclec
andomizeo dala stuctue (use rorcdorr
) Svip litt : A siplist t o
ctuchure)
Contnuul- tha dada
to
Coinp
eleme
Soded delemert
SoHed d d
ed to store a
Stiptkt t talled
Hat ittoky
everal elementz ef the l E
t cp
spt
Nercge
Leaich me ir OClogn)
ist
exlended Vef6o o ha linked mclude
hcluode
t on leves
the leo)
pae,he
ncluder all paie,
he level o
for and lewd
lovd
includer ewe fouth pa
ery Cecord par, lecel a
>Houh toble
t an
Ovay o Some cneed
se Condaioing he Ce.
houh toHe called o Cbt/tobe
»Cash posion o/ a
> oh durclion
and the tlot uhase that lom
T5e mag behseen item (tey) On
Temaq
he hash Lable &talled ouh esunc/on
belon in
Hate item fn the collecuoy and etun
The hauh -funcion any
6te
he hosh lable
pe hoah -funckion
mothodedirder metkod
. d u l o diritioo
. foldie mehoc
Mi sayuaIe molhd
3
Hcahia
a dalg stuchue.
on implementohon o dtelooriey
yaluest
techoque to plare a lage domain af Cey
ashin
oubing k a
i oleulaled
lable ond th e lo cothon
Specfc locaho n the hauh
funclion
om he oy value lcll ung he hoth
f (cC).
ond deletir
hen Comlexity fu ocuchi, iner
>Hah table
an
GHay 9| Some fe ed « j e Contaning Ca
he lcept.
ti
o ot/tahe
hoh taHe called
Cah poon pl a
loh Junclion:
Cn itemCtey) and he slot whese that lom
The ma
Thmangbehsen
a ealled)ah esuncUon
in h a hah Labla
belor
belong
în the collecio) and setuin
Hake any item
1he hath -fncio ti whee
namee betweer
betuee) m4). wheie
and (m-).
0 gnd
StoE
he fange
n nteged in
oldine methoc,
Mi suare me-th
it by he
t he
hto)e /Sre
3 0sbt bucket hla6) 26/s= 1
h(1393/c=3
v a l u y
1 ht9)-1T/S =
3 93 h(29)-99/r= f
h (3o)3o/S= 0
oah oble
e (tan)
ikem (ta)
Hese he hah cfunekon begint by dfvidig
. folding Medad: oeaual -S2e)
piecer (the la piece may nDeba
fnto e9ua ge hath volue.
-» five hae vesuttig
are then odded toReher
There pecer
966sT4U4
for exorople:
the Ce
t nto rou o
e aboue
Dividing
99664|u 3
to <lo&.hen
to
astume haB -he
hah tade har
we
t Phdex iscfored
mid s9uare method, toe fit square Ih
he
square metkod. ?n
3. i ddit
gt(i.e ddle porlier)
(i.e tiddle porie)
of h teulting
Ley and
Lem) extraet Gome porion
il ha kay î u.
Jo exar le
(44)1936
diitt ie 93 un peefom he
E eabackie, lhe middletwo
e 37. td= 3
Mbdulo divi&on
haah lunckob
x Characdeiut o gevd
to Compude
Should e yey eaty anc qur
. hefun clior hould Ve
dfrtibve he lteyte t4
shbuld unfoomly
a Tefuntio vales
two dif/eent ken values
wo d}fesent di'ces
Load fackoy
elemerts inces led în hath lable (N)
he soio o henumber of
i caled load -Jortor
leod -Jactor .
M.
mofe düdinCE e(oid (eus) Ofe
IE& debne a when tuoo o
ColRson:
addiesr.
to the me
plhysa
maped tethniquet methodt,
colfion
toltkon
setoluhon
s etoluho techni9ue! n
*Tosesotve
collftiont we ule
lechnique
Colliéion seesluhoo follocoa
re claceyhad as
sesuluhon techniquet
Collsioo
Colioo Kecoluhor) iechniguel
2/10= 2
42. 10=
o. 0 O
Advonla9e!
I Snle to implement
a
manty element ai we wont
a t h table never -il.
co uoe an nEer t
two pmber t .
8ap bekuicey
tabe.
hC)-67.m Size pl he hath
0 tolliio
h (o) o,
t0=
20 110- collo
ho,) ={6o10)+1), 10
710
h20,3)= o10)12) 10
3 33
430
h2) 3 103
3
h20) 3D10 0 Colliei
36 ro= 1/10=I Collifion
h20,1)= (267 16)41)
3 Collsb
Collfo
h(30,3) 10)42)/10=10= coll fay
6o)
10 2 call
h302)- (30/.0)+2)/10
h(30,4)-(3t/.10)+4) 10 =
4 1D =4
3s)= 3 / o =S
6
(&6) 367 to
Adyodoq uied.
No extra Space îu
Diodvante
Seach time D(d)
beleioo R dPlhcut
E,3..
hCLoy)= (tenm+ 1)/n
62.
Example: t6, 91, 33, 1E, 39, 36 1/d =
a
ha (36,) =(341.10)+
hu)-42 1o-2 =0
o 36
hC16)=16/10=6
hg(363)-6/0)+7p
h6a) 62/10 =
y
hG)= 7 to = 3x
42
-
hg
19 *>){1o =6
( 6 , ) (6-/
u h =I x
6 h23)- a . 10=9 ( 6 , 3 ) - ( 6 / 1 0 ) 4 3 ) 7 1 o
7 ,29 hq
1
h(36)= 36/10= 6 =((62/10)4 42}10
= 8
ha (62, 4)
Ddvanta
No exba Spate
onan cluttesrg setblyed
Seme ppb
Dedvandeg o cCunt t o o ltee
have the
Cetondaw clutlein
cOme lotcechon
ha to be
wteo heu
Seauente
fndir clot
No 9uaronlee
e u l6, 91, 33 16, 9, 36, 32
Double }aukhi
Doile ha:hing a (olfsom detolvirgtechnique n opey oddieceo
h e fdea of apringr a
eond hath -Junelioo-to lo
hah taHe ttueu
tohen CollGo
(hCtey)+irh(lop),.
Loheie h (rey)ey/.9
,Cte)ptime-eeyl. pame)
thGo m andi= 0, ,,3.
uhe pome P SmalleY
ot0»s)/10= S,1o=s
bl3))}1o>
hz0)=30/ 10+ 01»(9-2 = S Collko-
2s/))/10->St0)710
s}1o
Ora-
hl3)= 3s/d+ 10-olliki
)101 /
1»(9-1s/h))10
h31)- (ix/t0+ ))10->S+u)/D= 19/
(9-1sh)}1o=
h3s)-(3s/t0 42 9
6/10 = 6 t
10-
(9-36/h)}10-6-10)).
h36)36/10 + Dr
Advonton
o etia pace
Alo im Oy cluuderi
Cecondarg clutdevg
cate.
clo) fn toott
Ceach me f
Pchashing:
Rehahinq 1 colleclioo vesoluion lechnique.
bered
he loadocto
cach additio) pl o neuw erty to -he map, chec
0 95 not
t e-dbned Nalue (o da/ault value
veadel ha
giuen), Jher ehat.
mak i he
reviou Sze ard
make a neud amay e dauble -the
Forvehath,
he)ke.dze.
39 10- 7 19. 10
ST10
to insest more element coltsone
lbo table i almoxt ful ond i oe ty
ncertiont uwill dai,ente
we
till Teho
ocur Gnd evertuallky uher
tll should
table S2e sae h on
01o hen we
we
Should
he tale ize. e o
elboabtinq betonmes 0 , ut do í not a ime
ome
table, hal
saefa new neu hoth
dasle table Sze a 3. and
male he
we will pvefer u
number
fune o
uil) be
49 33= 3
397231
3 9
2. 3 22
1323 1
accomedabe new rceydion,
lage to
he hah table fidenr
lyu
Exendblelac It it a dynomc haih mehod toheie i dietorie
to haih dada. It on Jloy?blu mebed kh
Ond buket Oie uwec
he bah Juntklon allo eapeen ce dynomi e ChonGe
dieotorer Dola
ueer dede p09
ucke 2 3
Suppoee the oba) dendh « X. then-he tlath funekoo yetu
Nah Junekion:
6 - tCDOD
7 DON
- DO110 9bj0o0
0 OID I0
it always t. thut, he hathing-fom
and loa-derth
IAally, he olobal- defth
id
hcest 9u 10 d0o)
ente no OU Jloy.
diteckoyes tuth 1
n e t 37 9: All ! hece elemert 31 (11U), 7('U), 9(1001)
t. toe dontencoundy
Ahe
he buct ot
buctet poinled od by co1 ond
oveloo
37 2
dada elemest 2o (1 b160) uil couie the averJlouw.
nteit ao; InCeskjo) of
o0elotd
ot
11
nce 96 Globol dethis 3 3 L (116to )e Conideed, Theegote
in he budtot po inded db dijecdony O10
best it
00
D Ovedlod
by Lkep7eaa, arca
butket ovedlous aol t die
no
deph Cea),
dheceoe ave
no
depthbuketGlobo
a elemeydt are Tcharled
i E ard
doublea bd onr he butle
i doubled
i t enunmbe
Gy
Finallhe olp hahin -he
oll
uuketr
Oo
O
Nunbesah Complu-d
Thus
Advanto8
a d a Beldeval lesr, erpenkve(indemt L Comfut
Dada- lost nte -heoiag Capa
* lo
No poblem A
tieateS dpamitak.
chougee n hashikp efunekion attvdald otd
h dyrom'e
aEneud hoxh unci
Valuer Oe dehauhed