Question Bank – 2
1. Distinguish between Decrease and Conquer and Divide and Conquer algorithm design
techniques with block diagram. Develop insertion sort algorithm to sort a list of integers
and estimate time of efficiency.
Sort the following elements using insertion sort
25, 75, 40, 10, 20
2. Define topological sorting. List the 2 approaches of topological sorting .
a) Apply DFS to solve topological sorting
b) Apply source removal method to obtain topological sorting
3. Explain Strssen’s matrix multiplication and derive it’s time complexity. Multiply the
following matrices
a) b)
4. Develop the quick sort algorithm and write its best case. Make use of this algorithm to
sort the given list
a) E, X, A, M, P, L, E b) 25, 75, 40, 10, 20, 05, 15
5. Design an algorithm for merge sort and derive its time complexity. Use this algorithm to
the given list
a) 60, 50, 10, 35, 25, 75, 30 b) 67, 90, 12, 56, 23, 34, 45
6. Write the recursive algorithm to perform Binary Search on list of elements and calculate
its time complexity.
7. Define AVL tree. Give worst case efficiency of operations on AVL tree. Construct an
AVL tree of the list of keys
a) 5, 6, 8, 3, 2, 4, 7
b) 14, 17, 11, 7, 53, 4, 13, 12, 8, 60, 19, 16, 20
8. Explain types of rotations with example
9. Define 2-3 trees. Give the worst case efficiency of operations on 2-3 trees. Build 2-3
trees for the list of keys
a) 9, 5, 8, 3, 2, 4, 7
b) 50, 60, 70, 40, 30, 20, 10, 80, 90
10. Define Heap. Explain the bottom-up and top-down heap construction algorithm. Apply
heap sort to sort the given list in ascending order
a) 2, 9, 7, 6, 5, 8
b) 1, 8, 6, 5, 3, 7, 4
11. Design Horspool’s algorithm for string matching. Apply algorithm to find the
a) pattern BARBER in the text JIM_SAW_ME_IN_A_BARBER_SHOP
12. Explain N-Queen’s problem with an example using backtracking approach.
13. What is backtracking? Apply backtracking to solve the following instances of subset sum
problem and construct state space tree
a) W={3, 5, 6, 7} , M=15
b) W={5, 10, 12, 13, 15, 18} , M=30
14. Solve the following instances of the Knapsack problem by the branch and bound
algorithm. Construct state space tree
a)
Item weight profit
1 4 40
2 7 42
3 5 25
4 3 12
b)
Item weight profit
1 2 12
2 1 10
3 3 20
4 2 5
15. Explain the following with example
i) P- problem
ii) NP- problem
iii) NP- complete problem
iv) NP-hard problem