Vous êtes sur la page 1sur 5

Module-3: Greedy Method – Review Questions

Introduction
1 Define Optimal solution and feasible solution. 2 Jun 13
2 Define Coin Change Problem. State the greedy method to solve the coin change 4
problem. For 49 rupees, find the denominations with least no. of coins. The available
denominations in rupees are { 1, 2, 5, 10}
3 Define coin change problem. Write the greedy strategy for getting the optimal 5
solution. If coins available are of values { 2, 5, 3, 6 }, find the least denominations for
a) 55 b)77
Job Scheduling
4 4 Jul 16

5 6 Jan 15

6 6 Jun 14

Knapsack Problem
7 6 Jun 14

MST
8 Define MST. Apply PRIMS and KRUSKAL algorithm for the following graph to get 8
MST. Show the intermediate steps.

9 8 Jul 16

10 8 Jul 16
11 10 Jan 16

12 9 Jun 13

13 4 Jan
2015

14 8 Jun
2014

15 8 Jan 14

16 8 Jan 14
17 5 Jan 13

18 7 Jul 12

Dijkra’s Algorithm
19 4 Jan 14

20 10 Jan 16

21 9 Jul 13

22

23 Apply Dijikras algorithm to find single source shortest path.


path. Consider source vertes as a)
1 b) 5
Huffman Coding (New topic in CNBS scheme)
24 Construct the Huffman code for the following data. 6

Also i) encode DAD. ii) Decode 10011011011101


25 6
Construct a Huffman code for the following data:

Encode ABACABAD using the code. Decode 100010111001010


Heaps, HeapSort
26 Construct a heap for the list 1, 8, 6, 5, 3, 7, 4 by the bottom-up algorithm. 4
27 Sort the following lists by heapsort by using the array representation of heaps. 6
5, 2, 4, 1, 3 (in increasing order)
28 Sort the array 2, 9, 7, 6, 5, 8 by heapsort. 6

Vous aimerez peut-être aussi