Ada Assignment 2
Ada Assignment 2
Module 5
1. Explain n-Queens problem with example using backtracking approach
2. Apply backtracking technique to solve the instance of the sum of subset problem
S={3,5,6,7} and d=5
3. What are the two additional items require by Branch and bound technique,
compared with backtracking. Solve the following assignment problem using branch
and bound technique, whose cost matrix for assigning four jobs to four persons are
given
9 2 7 8
6 4 3 7
5 8 1 8
7 6 9 4
4. Solve the following instance of the knapsack problem by the branch and bound
algorithm. Construct state space tree
Ite Weight Value
m
1 4 40
2 7 42
3 5 25
4 3 12
The Knapsack Capacity W is 10
Module 3
5. Define AVL tree with an example. Give worst case efficiency of operations on AVL
tree. Construct an AVL tree of the list of keys:5,6,8,3,2,4,7 indicating each step of
key insertion and rotation
6 Define Heap. Explain the bottom-up heap construction algorithm. Apply heap sort
to sort the list of numbers 2,9,7,6,5,8 in ascending order using array representation
7 Design Horspool algorithm for string matching. Apply this algorithm to find the
pattern BARBER in the text:
JIM_SAW_ME_IN_A_BARBERSHOP
8 Define 2-3 tee. Give the worst-case efficiency of operations on 2-3 tree. Build 2-3 tree
for the list of keys 9,5,8,3,2,4,7 by indicating each step of key insertion and node
splits
9 Design Boyer Moore Algorithm for string Matching an Apply Boyer Moore
Algorithm to find the Pattern BAOBAB in the
Text:BESS_KNEW_ABOUT_BAOBAB
Module 4
10. Explain the concept of greedy technique for Prim’s algorithm. Obtain a minimum
spanning tree for the graph shown in fig
11 .Apply Dijkstra’s algorithm to fin the single source shortest path for the given graph
by considering ‘s’ as source vertex. Illustrate each step
Charact A B C D -
er
Probabil 0.4 0.1 0.2 0.15 0.15
ity
a) Encode the Text: ABACABAD
b) Decode the text:100010111001010