0% found this document useful (0 votes)
79 views3 pages

Ada Unit - 5

The document discusses greedy algorithms including their general characteristics, disadvantages compared to dynamic programming, and examples such as the knapsack problem, Huffman coding, finding minimum spanning trees using Kruskal's and Prim's algorithms, job scheduling, and Dijkstra's algorithm for shortest paths. Algorithms are explained and examples are provided to find optimal solutions to problems like MST, knapsack, and Huffman coding using greedy approaches.

Uploaded by

Jasoliya Dhruvit
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)
79 views3 pages

Ada Unit - 5

The document discusses greedy algorithms including their general characteristics, disadvantages compared to dynamic programming, and examples such as the knapsack problem, Huffman coding, finding minimum spanning trees using Kruskal's and Prim's algorithms, job scheduling, and Dijkstra's algorithm for shortest paths. Algorithms are explained and examples are provided to find optimal solutions to problems like MST, knapsack, and Huffman coding using greedy approaches.

Uploaded by

Jasoliya Dhruvit
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

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