Question Bank
Question Bank
paka 6 or 7
6 Or 7
7. Define Knapsack problem. Solve the following instances of Knapsack problem using Brute force
approach paka 7
1 3 $50 1 7 $42
2 4 $30 2 3 $12
3 2 $60 3 4 $40
4 5 $40 4 5 $25
8. Solve the following instances of Knapsack problem using Dynamic programming approach. And
Memory function method. Knapsack capacity M=10
x Define Transitive closure. Build Warshall’s algorithm to compute Transitive Closure. Solve the
9.
following directed graph using Warshall’s algorithm.
this or 10
10. Define All Pair Shortest Path Problem .Write Floyd’s algorithm to compute All Pair
Shortest Path Problem. Solve the following directed graph using Floyd’s algorithm.
11. Write an algorithm and describe the time complexity for the following
11 Dijkstra’s algorithm
may be Kruskal’s algorithm
Prim’s algorithm
12 or 13 --
i choose 13
13 - - - -12 or 13
Source – 5 Source – a
13. Solve the following undirected graph using Prim’s algorithm and Kruskal’s algorithm
read this 13
14. Define Huffman code. Construct Huffman tree and resulting code for the following
Character A B C D E
read this 14
Probability 0.4 0.1 0.2 0.15 0.15
i) Encode the text: ABACABAD read this
ii) Decode the text:100010111001010