ADA (BCS401) Model Question Paper
ADA (BCS401) Model Question Paper
ADA (BCS401) Model Question Paper
B) Apply insertion sorting method using decrease and conquer approach for the 10
list 30, 70, 20, 50, 40, 10, 60
OR
Q. 4] A) Apply merge sort for the string 70, 20, 30, 40, 10, 50, 60 and find it’s time 10
complexity.
B) Apply strassen’s matrix multiplication to multiply following matrices. 10
1 2 4 3
𝐴=[ ] 𝐵=[ ]
3 4 2 1
Module - 3
Q. 5] A) Sort the following list using sorting by counting algorithm 50, 30, 10, 40, 20, 10
60, 70
B) Construct a heap for the list 1, 8, 6, 5, 3, 7, 4 by successive insertion using top 10
– down approach.
OR
Q. 6] A) What is AVL Tree? Construct of an AVL tree for the list 5, 6, 8, 3, 2, 4, 7 by 10
successive insertions.
B) Construct a shift table for the pattern BABY and search for the same in the text 10
BOBBY-LIKES-BABY
Module - 4
Q. 7] A) Apply Dijkstra’s algorithm to find single source shortest path for the given 10
graph by considering F as the source vertex.
B) Apply Floyd’s algorithm to compute all pairs shortest path for the following 10
graph.
OR
Q. 8] A) Construct a Huffman code for the following data: 10
Character A B C D -
Probability 0.4 0.1 0.2 0.15 0.15
Encode the text ABACABAD and decode 100010111001010
B) Construct minimum cost spanning tree using Prim’s algorithm for the 10
following graph.
Module - 5
Q. 9] A) Apply Branch-and-bound technique for knapsack problem by taking following 10
value n=4, M=10
(P1, P2, P3, P4)=(40, 42, 25, 12) and (W1, W2, W3, W4)= (4, 7, 5, 3)
B) Drew the state space tree for solving the 4 queen’s problem by back tracking 10
method.
OR
Q. 10] A) Explain the classes of P, NP, NP complete and NP-Hard Problems. 10
B) What backtracking? Draw the state space tree of the backtracking algorithm 10
applied to the instance S={11, 13, 24, 7} and d=31 of the subset sum problem.