Worksheet DAA

You might also like

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

Worksheet DAA

1. Given the jobs, their deadlines and associated profits as shown below:

Then, answer the following questions:


a) Write the optimal schedule that gives maximum profit.
b) Are all the jobs completed in the optimal schedule?
c) What is the maximum earned profit?
2. Given the following lists with corresponding sizes:
X1 X2 X3 X4 X5 X6
20 30 65 10 95 16
Find the optimal merge pattern and calculate the merging cost?
3. Consider the following weighted graph:

Find minimum cost spanning tree for the given graph using:
a) Prim’s algorithm
b) Kruskal’s algorithm

4. Solve the following 0/1 knapsack problem based on the given:

✓ Weights: {3, 4, 6, 5}
✓ Profits: {2, 3, 1, 4}
✓ The weight of the knapsack is 8 kg
✓ The number of items is 4
5. Write sequence of decisions and find shortest path for the following multistage graph?

You might also like