Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ADA Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

elASSMAte

Date Jate
Poge

wppou e okouuay zamu panw


4 Ton) TA)+c.
b 3

Tt) Ot). t-i Cmparwr


luman onpayu
arbn seanch a 2 aumn
Jnsaneling alaprihm
nu

whun it i
pvkeulan slsmunt aud
su

I. naan narch: Ave he, onpoin-m 2

Bi. kun

Hcemplar C)
Ordn
E 2,3,4, S, t,7,v,*, 16

hOonar coast O (4)


Hvay tast OCn)
Ne. Cotoriaion i 4.> O04)
Sutpo we
uar b onth to.
No.
otrnporis en 10,0(10)
we ou bua n . plasnk "

to pleri Ot)
Len wumher o lsmns.
binauyARaHCh

In hina all Hu elpmons u


Aeaneh

b sorbued eiken acconding


or
denoliinaj
oHden 1 a eli seaneina) CHaen nhm
hchnios |4.5 SHie bias
cuillunay unchion ).
x 1,2,3,1, 5,6,2,
S,,9,?
,8 w a tau
no Companusi
aamn + + 3 + . tk
3 pasu au ALeolod. k

be Ces klkt2

Auppon h Want o sianch he nuobll


plemen, nly i companiaien wil be
neuduol 0C
Loyht1 ( logN )
Wons Cal
Swppo we ou
bainayX almmnt bis and ue

uppo he a u usina ke
want b stanch 4, hie necol onlg 1 Conapauin-
n k loas? i.Cbesttase
No. Compauitia Compeuhy
Jn wona au k
n ) Companims
Bet case
OlloA, ane nllolko
k lom honst case Lo
NOTE Ju o (logn)
rieldle elenunt can
eihen bu elt bias be faunol Aueno cae
o uots hias in Cass
Date elASSMAte
Page Date -

Page

'Mauum Apauina Jue


Aa 10
u Cun be
mumum shanning
h huo alaorihmy.
impemenkud ky wuing
- Phum's Mgpsihn.
-Kruskal's laphihm.

Prúm's Aaeihhm Atap 3


i alapsihn io wued b avnid loop.
wcon.
nd he Ldge hak has ununum weig
MC al Mu knwn wrhces, Auch hat |
eu o-Loop
Aep whan u ou cave allho uenha D

Sta 1:

Total wuiqht 10 to 22 12 +14


3
elAsSMAtee
lASSMALe
Dale Date
Page Poge

Alaotihm dsign Jachiapa


kxack
eudy mehod:
Alqerikhw teeps
Crua a aet mutaet ha ho MST. Aolue ophimisahon purblum mauiwuzawhonm
1. incluole in
abuady urlites in
oWiiuzahon ).
he orktes
wahc
all Hhu
.ssiqn kuy
valuuo all
Ihihalize all k valu Jhu prudulind abakegy (ahakie
Hu input graph. pproach ).
INEINITE. Asaiqm ty vlu 0 oH may nst povide
hu ophinizaie

valw all ophnizaien prhln.


on
all uwrht
3. i mataet oloLsnat incude W e haw cai
hwu
a)Pick a wer u which w hat 20 10 S 2 1
has
o
nununumn SO S no
in maek and a
want Rs 143 wh
niumum
we
valu Connd.
b) Snelude u h ukset.
)upolake key valu oall ndjaunk
wevh o u o updakk ku ky valuu dinst
vaules,herake mnnah all odiacen u ih COn

SO 2
wwht V, s e i t osdlge u-v 2S x 1
las Hhan ho pwiou vàluu ov.
updak Hs ku valu as wiant
U-V.
x 1
1

Lo. o Conn Corn neeoloo


mehoed 7
Sh qeduy
clASSMAte
Date lassMte
cte
Page

( bsk approach : xamplh


Sn her otenth
Sox : 10D 18
20 X 40
2
Pa 10
Lx,1
Capoci 20
3
Ne. t o n s 6

Jo make 143 upw quuely


methud thaag.
hak 7 Crins whuu w u het Mone puik dajeck nst
euuhicn 6.Ao, quouy unethoo
may nst pronicde Hi dphisLd A
auwa 20
1 x1 + 1S x 2 1 0 xO
Kapaack pdebm uachond kapsack IS XO
ponlem Toraeains 2Sx1+ 2x t
udy mehhool ton be watol o Ao
29.2
achionad knapsack problm.
iknapsack capatihy
i) We h a n o. aohieck
2 Ls stignt chject irst
iica dhjec i ha wughk wi.
iv) a achon losni <1) »j 10 1
in a kuaksack Mun Hu 4laceol
ii Pi pufil o 10 x 1S+1ox1
20

v
:

tatoal waiah
dhiect). Oxt+
all eheosen
ooiec ?4+ 1S X1
Total peins O x aS+ 1Ox
31
clASSMAte
Date
Page

JsSMAte
cte

3Mandinaum -pue/weiak objuet J i Bubb Se


Phkh/weia
1.30
11
1 10
1
1.6
Pah 0 1a. war
Q4 S
1S 1.
Pah S 1 13
71 10 1 13
Pakh S 10 13
Pakh 1
10 1113
h n au n lemnt we hud (n-1) rend
OX1R 1 x1S + x10. 20 elomank (n-D pa
Ox 2s +1X24 4 1 31.S 1 a 1 h-1
Couparusuan
has2 -2 Compausian
3 2a n - 3 Cempau

Worna a :
Total no. Cohauscu in wOrat Case
+ 2t 3t t--.t h-1 -

o ()

But tau
elkunh Arted in aswnodiy
all ha ar

o Jert Hu zlemunt
orden and we ale twan
he wed Cnley uu ta
in ascendnay OHolor.
ani h elumnh
So, in 1 has i Hwu Oden in
clAsSMAte lASSMALe
Date Date
Page Page

(n-)n2 (n-)+ A(an-): - n


6
AD Awopina (h -1)
Ex 2 3 M S6 CompeiMO oCn
1 1 2 3 4S6 S
PA
Ouick cork
Awuna o chaman as piat aumend
Cn elomank o

Bit cas 1 pau naelrdN 1 elmunk, char2e hu i u t demunt a


Comaiwon h-1 pivolenmunt.
o r Lose h-1 has an haded no 3 11 2,9
iomaru on n-1+h-2+ 1-3 t1 Pass 1
h-1 Paw 1 1 9
-1+n-2
2
-tnt2+ h-3
Wor a
- pa n-1+ (n-2)+2 a l l Hu lunnh au onte in aundng
h- 2a (n-1)+(n-2) 4(n-} dateueling ardun
3 6 10
lo.
onpouniou /(h-1)4 {(n-1)+(h2) Pan11 3 M 6 79 4 10-9
ti0n-1)+(n a2) +(n-3 PassT 1 2I 3 S 6 981o
Kn-) +(-2)..t3 6 2 10
-1
(n-1) (n-2)+ (n-3) +(h- )+ (n-)
(n-1+ (2+ (n3)+(n-)
-

Hww uns n elennh (n-1) earne ane

eeoleolp a t Cau
lasate
Date
lasStee
Page

1pa)n-i lomtauni on An aL:

-n-2 oraunim
h-1 laas 1 Sn a un
Jatal no oomparw'm:1+2+3th-

0Cn)

n ur ubi hawn halp ona Auraa ho ublia a


ha ai n yel Hu wl uauesk hit ta
h-k
Pas 1 2k-1 2 - 1
ND. d Anaroas we. Aubli
Pas 2'-2-a:-2|2k-2 pMpa
Pan -3|3 -3

No. Cmpaniain Onden


-1 o(n

lo q n log3
k 0 a , M.
lon M: kloy

uuny kew unu u hau h


lompauo
Curod we a haurina lo pae
h e Co
1+ n
elasSMAte elassMAte
Date Date
Page Page

Adinay sdarka pak prahlenn: Ditlsha


Loay lo Maprihnm
kloq? oa h
NLtah om
Aueuo o. o iat d_denotes he distante valu a ned L.
toloustes Ho stahus label sa knd
Jh &euA pa ou b nearln Campansan h n p shnel gon pumanent and t siauds
Jota umbon cmparison în Avay Cae
n loan n emperary.
,
OChvas n ) Cij a cos aueuuin lnk Ci, j)a
en a Ho prshlum.
be Cas o n logn)
hont Cass o dialantu valus di ad ih shho akel
Ava, Case
(Av cane dekemin Hu hime Comleiuty) Alopukhm Alps:
i Jnikiaizaion.
saion Hhr zno distant valu o nau
and lakel ik as Penansunk. LIu slale e
hudu s io (o,p )J.
to ney nad c disbance Value
a n d kakeel hem as nmfoFaruy.t l u
stake o e u OHwr nodle u C FJ.
Dinass Hu herle S as hs uwnst nde

M 2: Dislanu vau
updes and euvunt
ude deignah m nplaks .

Cihe Ru index. o1 Cumenl nods


elasSMAte
Date
lassMAte
Date
Page cge

)Hin hu se 3nods ik demperany


Labels Hat Can he rea chud hem He
Cunent hole i b a
link ij). u4olos
disanu wluis hese hodes
o each j eJ, Hu dsnu valus d d
huds udakd as Aalun
he oi un oli e an ind Hh shorkesk path pm
anen in Ha netwonk hishlem. sol b all thn no das usna Diksa's
Deimina a hwde hahas ualla alaerihm
oisbases valus di aano aladles jej.
Jon Auth ha nn dj - dj ,)
JEJ

C, )
Cha vaus Arode
He labs i b panaAmt C
hnde

A a : Jerminahioh rikerio he cunen no


a l l noclss Hhol coun h uacbaol um oAioyiokedl as

u Ake nocl 4 i ( , f)
nw ham heun pemanenkly lehalu has Alate Ca tk)
Enew Chen node
anAtap - hs anu oleuu
w COnno Mac couuy tinnponen _(ts,t)
Labil sodi n Ahe tuwwnnole , Hsn'
eptay lakels become pmanenk: (,4) )
elsSmate lasMAte
Date cte
Page

pd , ano bu uahd Naw Pehwun Dd 3 a o nods 3 Loa


3 G Can om .
Cmen hode 1 dialantu valuu.
Hhe Amalluk
u d a t dilanu valu on thest naol, h u s lob! dwda 3 chaq b

d hun a, D+a) tenfona


Lod 3 bComis w u m n nodo.
Low, amana he nod , 3 cund , hod ne as not don (Ateh 2ads), so e
has u Amall listente value onm ansthe strp 2.
aabus lohel dhod 2 thanaes h
panmanint so is atate (9, l
he aehu a n s 6 nmainn kmpone (20,+)
Lods 2 betmss he cawmaat nok

Sap 3: Co Co,U

C2, ) Lode anel 1 an be rahol srom H


Cmenk hvd 3
value Jon u
Adak_distan
20
dy hn (22,9t1)=
dghun C1,1t?)1I
(o
Loda 3n can ke machud rom Hu Ha Ama llesk astenu value
uwenE hode 2. l a h u s label o wd C charges o
humanent, utile ho spahus o4 au ns
updale stanc vaues ox hus ndes
dz mun( ,t (o) 9
7 mpes
Cool 6 becmes ke cunintheele
in ( 0, 7 t S) 22.
d hst clu Ake 3 ails ), AO
he an
CIASSM
elasSMAte Date
Date
Page
Page

A.Amahu aks 10D stc oshort lo29 n a m


he it wl
Ytzo,) AiA Auck stor How uch
lak o ort 129 name

Quik oCn losp n)


h= 10
(o,p
Mamas1094 x 1024 (ND. Conp
lom' o
I02
Nod S Cah be nmathd pem o uuw :l024 X Jor
hods G 102u0
d a k distanu valus on nodle 0S. on 12 Kames 128x lo 128
ds in ( Do, 11+) 20 29 x loa?
6
Atalus thanA. o eaamann.
Lods S becoms Hhe wenr no do 10340 Comeaugion in lU0et
nan hbd ne Ceunnat nLach
un thn
nod. Hnu hwde 1 t02M0
ywh punahntly
Aoaled nd in 216 Componi en . 1 0 16
02 uo

A acuns take 200 C h sont urd nama


wi huwobk Jon. Hao mau nanuw n h
ADadio in 0D Ae.
Bcbble J0nk o (
200 Ac 20D nOm
200 Set 200 A. oo
Ae (au.Co
elassMAte classmate
Date
Date
Page Poge

nsenhion Aerct:
he how w inswt an olemn ino an alrers
l o utmns.
h16 0oOD 0 d

Two arkap A anl B auaulake fen


au elemns a Aorkrd n cXndinA oden
uio u also wan hu lnunk hhe
N
ocnaina daka 10 ucords. Packasg Ä ud
O-DoDIlinus, packa4 hadlonlo Jortd n andng Orolen
Hmto nrocw n ucond. hat b He
a l l valu en wrichh package L 3 9, S, 6 Ne.Conapoi
wll ueu own A.(faukane Bult a Pas1 , S,
us hna han patkay A). Pano 1 3
A) 12 Pas 34
810 D)S Paan L
A 0.0o01X|o x o un n6 , 1
0.00oJ x 1o0
Miu inhe cau hou 6 elomersau
huy aw h tlomw
B10 lo o o l0 auo n no Seanw i
- h a u au nuded. 3n ho
hert tase,
lo $ loa l0
xIo ac pendo Comparuslone, He
1
ta he. oCoeeision H1

hhrat cau
all Mo elemarh anw Sorlo in decendi
Oriolar an w want ho lemns o k
serhh in ayendin Orden
elASSMAte alAsSMALe
Date Date
Page Page

Pous 1
,3,2, 1 No.t evaax Conmiin in ? pa: 3,
3,,1
Pa 1 32,1 2 ehuua n.Comanisim in n-1 ka: h- 1 +1 -1
Pa
Pan V Tola ho Onpanii en.
Fans 2 3 , 1 , S,6 S +

elamEn a hn h1pam ou
LLd.
1 a no o Cos 1 t2+ 34 h
3 a no Connpanuen3 Mt -1
.

COnuauien M
Toted no. oCommpouia y
1+2+3t. t-

hOalk
a n allrnahne Souuente erhces anel
Huenaoe Casl
Aveane o.OCempainim in kh has
4242
Tal i awalk hat nepihhen o
Anmg ne. oCompaniaim 1*e). das
eAAN *.
Cowpiienin pw24L
elassMate
Date
clASSMAe
Date
Page Page

Pah
Pat o a krad in twluich all M wnhu
au dahintt k Carapt 1 uol kaat V
in tas odopah) . ,V3
To upehhon dap ang wwhas axop
ha inst and last in"doad J Cad hayuln qpoph
VA
Een laphi
A qroph in wich huu anist a thail Trawellina Aalaman sblem:
ich cn all Hu dopp H qrapl A malp d ch au qinn t salsno aun
a

Callo euln oaph. Consn all Hu hu bas h waik a Bo uhis enackhuy C u


Lelapn ithn iuprhnay kdo ). and rehwun h he place whu hu sarkd
V3 p a h mas t hu shorkesteu
V

V2 e2. V
Th ooithi h ouins hamuilhom Cyca
ih skonkusk Aunghh hassinay nna al
Hu whw h u yaph exachuy ones and
hainay huninun Ahal seia.

hounlan lyaph
A graph in whic huu aut a han
tich Ceu all he wuha. d h onaph
(uninA al H wnhus wilhnk epehina
lak vekz in tas clend) Trlawiat
6 t 3+ 0tN?
3
lASSMAte classmate
Date Dcte
Page

.A binamy tau in whih u rn-ia nd

talluo AicHy bina u . 2ud


kau wi 10 LLau
hcol
A) Cannt hane nwn Hhen 1q

Ta weied 9t3 tu++7 exatky


has 19 nocls
)
12 nods
31 )has a ko chh °
tS noda
D) has biocy
Cemplae n au ru in wich lwy
hool ha uah Tcnd uds( X:eha edu)-
numk 2 x10-: 19.
inenna wods.n
. Oy ayas .Branch aund und Mehod:
)n 1 knapaack pusbem:
B)n+1 Volu Valuswvqbt
c) (n+ 1 M0
b)(n-)+1

kapaatk Copauhy lO.

Jah 1: Aor valus /weinis in duundig vd


wuo vaun valus /weigt
) 1:1(2+1): /3
- ) + 1 (3-1)+1 3
12
elassMAte JASSMALe
Date ate
Page Page

Enaesack capacihy : 10 SUM baut adlm


tuphen kaunol (Ua) rindaAuhut d oiun
- Vaus (v)+(w-w) {Vi+1/oit1)
S S1 Sa Sn n oihe inka
wCapacihy (ikal) whea m iu aaual h a
n intan.
(w-w) Remainina capaciha o knapaack S-1,2,S10,3S
Vt/wit 1 u besk value /hiank aman Sum - q
h nemoainina lkn
S1,83
|W0 V:oUBO+(l0-0)1D S:i6,t13.
LUB1oc0
S36,7
wiHhat 1 SUM: IS
WyV-Mo| W-0 V0v8-0
UB DE 60 uih 3 wi heuh 3
uh/ Wi uwill
h nieckaol,
i l epon nakimu
w v-32 W4 VovuD t (10-) A
UB 0
wih 3 ui hont+3,
DB67|hw- 9. uikm

UB 61
iy wiho y1

W-1
S:2,9}
w | V-6 UB6S Htlo-).0
UBS 6S
item 3 225
lASSMAte elassmate
Date
Dote
Page
Page

.A
A Matins kaok 200 xc to sont od ha
AVL Tu
a hidt balanc u . Vo a buaru
han ame wi2e sonka rw o a inauy stanch knu in uweh
t iolu diln t Auwbhu cud
uioy bhu io amost o

Heiglhk: 14 hu wauinun oluph aw

0D
2
AvL T
ITOTR)| 1
'123 OdoU Tt- o, t 1
BolanceAcon
129 odD 31 adriahhAetubbar

Jubru and uahk ubhu b k n n as

balantuach.
T)
iyht o t aubhu
T)humk oniuoxn subhu.

Avt tu
elassmate
Date
ciASSMAte

Dcte
Page

vRiasLTDrubk ncahn
20 1 , 12.

13

ncranm

12 , 1

2
alasSMAte
Dale
clasSMate
Date
Page Poge

. Tu
ho.i y a**-1. urch tnu with He
A.Bt o a M wun
Jh muninuum d. ooclu tn a AVL ne
otlmina ropnhy
Rout dL ondun b m.and ho.
o ku aru

huigt h = nin n. node oktiatth-f Cbm-


ww no.
o wads ouiaat (h-i Au Mu inkuma nede has allast| ubtue
)
Mininuum no.nelu AvL ras o higto an aw at m aubtnu
uac e AVL u o haiokri Mu intuunal node hauw alest |
u
Leanch Juu knp ound at m M-I kuys
n bina &iarch du lach hodk bas u ka Auhe leaves ane at Aame len
iv)
lcmnt ano hur au hwo AuhbAs
SM-wau(uwlhway) caneh ee Hunu Ondsn Lo. osube Np ux
uill at nulhee k elamenk and nul ) Wun
ubbue 3
3
w a has o ko m auhbu.

Comadae a B-Tu r d S i hw
olniny zkay alemenr.
Oncln ) 3 11,21,1,.,93, Ss 34,63,4s,u2,S ?,2o
kuy: m -1 3-12. 16, 11, S0,30,22

Ruvt1 h,4 uy
Adunal keel: h1 ka
classMAte
Date
clasSMAe

Late
Page ge

21

21$2
1

2178
classMAt
Date
claG
cte
Page

Daa can be fuotend eayunuall liks a

8Di1DaytuDab3oDahaDa 1 Da
uun Paealam
Nla huo qua Ahnudd ke plaud i arighk
in or diagonalluy.n Mauan unlen
e
haw hplac 4 quan in a xJ
(1xu) matnix.
n Bt nau each da nkuy uus r rub

Brca e innna wodle o wsad pn


thing
Aaorn onol uy aMnall dmk tann
2 Qun, Pagtnlg
eacha wd on
aslAihiona 2
he awoel in a
uo toha dae Acountt. Jo
beauaniolluy ust
SSmate

3
u.S,b.?310

u-1 3

i
CIsSMAte
Dale classMate
Page Date

RaRalan qaph:
elyu all Hs veheu ou 29ua Hu
calluo Aodan qroph.
panalli
dops:esk 2

n a ainph qraph Hu ahoula


ul Ro ud tmallul Adas
wptul anaph
Sna inpls oyas Hsu iv Hhu ist an aday hchun eu pain
no
l or, wi n i in callud camplubs yaph.
V

Al p sbuhva aunol endi a

i dops hae 2ame nhney and noim, Panou eaph


wu hn Hhu ade au taluo povall' Aopaph u talluol plonan i it tan he
dvawn iu a plane Cno insnchon).
N4

Campleh planan oaph


AComplsh ayaph uikh
h drasn in
Jeun os lom ehw tan
a
l
elAsSMAte
Date clasSMALe
Page
Date
Page

Ne tana draus a cmplak plana


alahionsip kwun no.adap,
h c e ard . o non
Kion qnap e: i-2
Gunuim 32 anu needsd

P2

hi sonmuwa y wppicakls h planan rap.


-
l 2
2x3 3x2
e 2 +- 2
6 6
_e
We nerw

(}tn- 2 )> 3f .

2 4 n -y>3
2x4 3x2 > 3>6 2n->3
n-u
Mis
ouula apucabu en plonu (n -2).
b. ehus

You might also like