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

Unit – 5: Greedy Algorithm

1. Discuss general characteristics of greedy method. Mention any two


examples of greedy method that we are using in real life.
2. What are the disadvantages of greedy method over dynamic
programming method?
3. Solve the following Knapsack Problem using greedy method. Number
of items = 5, knapsack capacity W = 100, weight vector = {50, 40, 30,
20, 10} and profit vector = {1, 2, 3, 4, 5}.
4. Write an algorithm for Huffman code.
5. Find minimum spanning tree for the following undirected weighted
graph using Kruskal’s algorithm.

6. What is the basic nature of greedy strategy?


7. State true or false: “Prim’s algorithm is based on greedy strategy.”
8. Discuss Kruskal’s algorithm for finding minimum spanning tree. Give
proper example.
9. Explain job scheduling problem using greedy algorithm. Support your
answer by taking proper illustration.
10. Define MST. Explain Kruskal’s algorithm with example for
construction of MST.
11. Compare Greedy Method with Dynamic Programming Method.
12. Write the Prim’s Algorithm to find out Minimum Spanning Tree.
Apply the same and find MST for the graph given below.

13. Write Huffman code algorithm and Generate Huffman code for
following
Letters: A B C D E
Frequency: 24 12 10 8 8
14. Using greedy algorithm find an optimal schedule for following jobs
with n=6.
Profits: (P1,P2,P3,P4,P5,P6) = (20, 15, 10, 7, 5, 3)
Deadline: (d1,d2,d3,d4,d5,d6) =(3, 1, 1, 3, 1, 3)
15. Explain the difference between Greedy and Dynamic Algorithm.
16. Compute MST using PRIM’s Algorithm of following:
17. Find an optimal Huffman code for the following set of frequency. a : 50,
b: 20, c: 15, d: 30.
18. Consider Kanpsack capacity W=50, w=(10,20,40) and v=(60,80,100)
find the maximum profit using greedy approach.
19. Explain Dijkstra algorithm to find the shortest path.
20. Define Minimum Spanning Tree

**********

You might also like