DAA Suggestion For Practical
DAA Suggestion For Practical
Write a program in C to find the minimum number of scalar multiplication needed with
the sequence of multiplication (parenthesize) for the following chain of matrix multiplications:
A(3X2), B(2X5), C(5X1), D(1X4).
3. Write a program in to place 4 Queens in 4 X 4 chessboard in such a way that they can
not intersect each other’s path. Show all possible solutions.
4. Write a program in C to find the optimal cost for the following fractional Knapsack
problem:
Item I1 I2 I3 I4 I5
Weight 12 5 7 6 8
Cost 24 15 28 18 8
5. Write a program in C to find the MST for the following graph using Prim’s algorithm:
6. Write a C program to implement BFS algorithms for the following graph. Show the
Input Output of the program.
7. Write a C program to implement Floyd Warshall algorithm for the following graph.
Show the Input Output of the program.
8. Construct the minimum spanning tree (MST) for the given graph using Kruskal’s
Algorithm-
9. Consider the following tasks with their deadlines and profits. Schedule the tasks in such a
way that they produce maximum profit after being executed −
S. No 1 2 3 4 5
Jobs J1 J2 J3 J4 J5
Deadlines 2 2 1 3 4
Profits 20 60 40 100 80
Deadline Profit
JobID
a 2 100
b 1 18
c 2 27
d 1 25
Find the maximum profit.
11. We are given the sequence {4, 10, 3, 12, 20, and 7}. The matrices have size 4 x 10, 10 x
3, 3 x 12, 12 x 20, 20 x 7. We need to compute M [i,j], 0 ≤ i, j≤ 5. We know M [i, i] = 0 for all i.
12. Write a program to find out a particular element from a list of elements by the method of
Linear Search. The list of elements should be given by the user and the key element will also be
supplied by the user . If found then output will be the positional value with the “FOUND”
statement otherwise print “ -1 with NOT FOUND”.