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

DAA Suggestion For Practical

The document contains 12 problems related to algorithms and data structures including matrix multiplication, binary search, n-queens problem, fractional knapsack problem, minimum spanning tree (MST) algorithms like Prim's and Kruskal's, breadth-first search (BFS), Floyd-Warshall algorithm, job scheduling, and linear search.
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)
51 views

DAA Suggestion For Practical

The document contains 12 problems related to algorithms and data structures including matrix multiplication, binary search, n-queens problem, fractional knapsack problem, minimum spanning tree (MST) algorithms like Prim's and Kruskal's, breadth-first search (BFS), Floyd-Warshall algorithm, job scheduling, and linear search.
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/ 3

1.

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).

2. Consider the arrray {2,5,8,12,16,23,38,56,72,91 } and target=23 Search the target


number by the method of Binary Search and also use recursive function.

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

Capacity of the Knapsack: 23

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

10. Five Jobs with following deadlines and profits

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”.

You might also like