0% found this document useful (0 votes)
87 views

DAA Lab Questions (Sem-4)

The document contains 6 assignments for an Algorithm Design and Analysis lab course. Each assignment contains 2 questions to implement algorithms using various approaches like divide and conquer, dynamic programming, greedy, backtracking, and graph traversal methods. Sample problems include binary search, matrix multiplication, shortest path, knapsack, job sequencing, graph coloring, and BFS traversal.

Uploaded by

Ritik gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

DAA Lab Questions (Sem-4)

The document contains 6 assignments for an Algorithm Design and Analysis lab course. Each assignment contains 2 questions to implement algorithms using various approaches like divide and conquer, dynamic programming, greedy, backtracking, and graph traversal methods. Sample problems include binary search, matrix multiplication, shortest path, knapsack, job sequencing, graph coloring, and BFS traversal.

Uploaded by

Ritik gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Dat

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

Implement all the questions.

1. Write a program to implement the job sequencing with deadline


problem using greedy method. Consider the following data for
the problem.
N=4
Job J1 J2 J3 J4
Profit (pi) 100 10 15 27
Deadline (di) 2 1 2 1

2. Write a program to implement 4-Queens problem using


backtracking method. Show all the solutions.
ASSIGNMENT - 6
DESIGN AND ANALYSIS OF ALGORITHM LAB
PCC-CS494

Implement all the questions.

1. Write a program to implement the graph colouring problem


with m=3 using back tracking method. Consider the following
adjacency matrix for the graph.

1 2 3 4
1 0 1 1 1
2 1 0 1 0
3 1 1 0 1
4 1 0 1 0

2. Write a program to implement a graph traversal algorithm using


BFS algorithm. Consider the following graph.

You might also like