IAT 3 EXPECTED QUESTIONS II AI&DS With NM
IAT 3 EXPECTED QUESTIONS II AI&DS With NM
Part-A
2. Construct all possible subsets of weights that sum to M for the given instance n=6.
M=30 and weights (1: 6) = (5,10,12,13,15,18).
3. Explain how Huffman trees are constructed for assigning shorter bit strings to high-
frequency symbols and longer ones to low-frequency symbols. Generate the Huffman
tree and code for the following.
character A B C D E
Weight 3 2 1 4 5
5. Solve the all-pair shortest path problem for the digraph using Floyd’s algorithm
and also explain the same with respective algorithm.
6. Evaluate the optimal solution to the fractional knapsack problem with given data and
the capacity of knapsack, W=50 using greedy technique and write the algorithm.
7. Draw and outline the step-by-step successive key insertions of the Optimal Binary Search
tree (OBST) for the given nodes and their respective probabilities are (do, int, if, while)
& P (0.1,0.2,0.4,0.3). Explain the algorithm for the same.
8. Write the Huffman’s Algorithm. Construct the Huffman’s tree for the following data
and obtain its Huffman’s code.
Character A B C D E --
9.Solve the following instance of the 0/1, knapsack problem given the knapsack
capacity is W = 5 using dynamic programming .
ITEM WEIGHT VALUE
1 4 10
2 3 20
3 2 15
4 5 25