DAA Lab Questions (Sem-4)
DAA Lab Questions (Sem-4)
e:11-
05-
2021
ASSIGNMENT-1
DESI
GNANDANALYSISOFALGORI
THM LAB
PCC-CS404
I
mplemental
lthequest
ionsusi
ngdi
vi
deandconquer
met
hodology
.
1.I
mplementbi nar
ysear chalgori
thm tofi
ndagi ven
numberanddet er
mi net heti
mer equi
redtosearch
fr
om theli
st.Theelement scanber eadfrom afil
e
orgener
atedusingther andom numbergenerat
or.
2.Implementmer
gesor talgorit
hm tosor
tagi venset
ofelementsanddet ermi nethet i
mer equi
redt o
sorttheel
ements.Theel ementscanber eadf r
om
af il
e orcan be gener ated usi
ng the random
numbergener
ator.
Dat
e:20-
05-
2021
ASSIGNMENT-2
DESI
GNANDANALYSISOFALGORI
THM LAB
PCC-CS494
I
mpl
emental
lthequest
ions.
1.I
mplement qui ck sor t using di vi
de and conquer
methodologyanddet erminetheti
mecompl exi
tyrequired
tosorttheelement s.Repeatt heexperi
mentfordif
ferent
val
uesofnandpl otagr aphoft hetimetakenversusn.
Theelement scanber eadfrom afi
leorcanbegener ated
usi
ngt herandom numbergener at
or.
2.Fi
nd themi ni
mum numberofscalermulti
pli
cat
ionfor
chai
nofmat r
ixusi
ngdynamicprogrammingapproach
andfi
ndt heti
mecomplexi
tyal
so.Consi
derthegi
venset
ofmatri
cesA1, A2,A3,A4withp0=5, p1=4, p2=6,
p3=2, p4=7.
Dat
e:3-
06-
2021
ASSIGNMENT-3
DESI
GNANDANALYSISOFALGORI
THM LAB
PCC-CS494
I
mpl
emental
lthequest
ions.
1.Writ
eapr ogr
am tof
indMaxi
mum andMini
mum element
fr
om an ar r
ay ofint
egerusi
ng Di
vi
de and Conquer
approach.
2.Wri
teapr
ogram t
oimplementallpai
rofShort
estpat hfor
agi
vengr
aph(Fl
oyed-Warshal
lAlgor
ithm)usi
ngDy nami c
Pr
ogrami
ng approach.
Dat
e:8-
06-
2021
ASSIGNMENT-4
DESI
GNANDANALYSISOFALGORI
THM LAB
PCC-CS494
I
mpl
emental
lthequest
ions.
1.Writ
e an algori
thm and pr
ogr
am toimpl
ementSingl
e
SourceshortestPathforagivengr
aphusingBel
l
man
FordAlgor
it
hm.
2.Wri
teanal gori
thm andprogram t
of i
ndt hemax i
mum
pr
ofitand t he sol
uti
on v
ectorforKnapsack probl
em.
Considert
hef ol
lowi
ngconstr
aint
sforknapsack.
N=3,
M=20
Pr
ofit(
Pi) 25 24 15
Weight(
Wi)18 15 10
ASSIGNMENT - 5
DESIGN AND ANALYSIS OF ALGORITHM LAB
PCC-CS494
1 2 3 4
1 0 1 1 1
2 1 0 1 0
3 1 1 0 1
4 1 0 1 0