Question Bank Algorithm
Question Bank Algorithm
UNIT-1
PART-A
PART-B
1. What do you mean by interpolation search and write the algorithm with example.
2. Explain in detail about Rabin-karp algorithm with time complexity.
3. Define binary search and write the algorithm with suitable example.
4. Describe about naïve string matching algorithm with example.
5. What is pattern searching? Outline the steps in the Rabin-Karp algorithm for
pattern searching with an example?
6. Apply the insertion sort algorithm to sort the following sequence of n numbers
stored in an array A.15, 9, 22, 26, 19, 55, 43, 99, and 2-Illustrate each step of the
sorting process.
7. (i)Discuss all the asymptotic notations in detail.
(ii)Explain about time complexity and space complexity estimation.
8. Write the algorithm to find mean and variance of an array perform best, worst
and average case complexity, defining the notations used for each type of analysis.
9.Define heap sort and write the algorithm for heap sort with suitable example.
UNIT-2
PART-A
V1 V2
4 1 3 10
2 V4 7
V3 V5
5 8 4 6
V6 V7
4. Write and explain for pseudo code for breadth first search algorithm and
discuss its time complexity.
5. Discuss about the algorithm and pseudo code to find the Minimum
Spanning Tree using Prim’s Algorithm. Find the Minimum Spanning Tree
for the graph. Discuss about the efficiency of the algorithm.
6. Explain the algorithm for Maximum Bipartite Matching and Write short
notes on Biconnectivity?
7. Explain in detail about pseudo code for Floyd Marshall algorithm with time
complexity.
8. Write an algorithm for all pairs shortest path algorithm and what are the time
and space complexity of the algorithm.
9.Explain the Dijkstra’s shortest path algorithm and its efficiency.
10. Outline the depth first search and breadth first search algorithm with suitable
examples and time complexity.
UNIT-3
PART-A
1. Trace maximum and minimum (using divide and conquer) algorithm for the
following set of numbers. 20, 35, 18, 8, 14, 41, 3, 39,-20
2. Sort the following set of elements using merge sort: 12, 24, 8, 71, 4, 23, 6, 89, and 56.
6. Define divide and conquer to apply the technique in binary search algorithm
and to analysis it.
7. Trace the steps of Merge sort algorithm for the elements 122, 25,
70,175,89,90,95,102,123 and also compute its time complexity.
8. Write the quick sort algorithm and explain it with an example. Derive the worst case and average
case time complexity.
9. Write and explain for pseudo code for breadth first search algorithm and discuss its time
complexity.
10. (i)Distinguish between Quick sort and Merge sort, and arrange the
following numbers in increasing order using merge sort. (18, 29, 68, 32, 43,
37, 87, 24, 47, 50).
(ii)Explain the steps in building a Huffman Tree. Find the codes for the
alphabets given below as according to frequency:
A E H I L M P R S X
2 5 1 2 2 2 2 1 2 1
UNIT-4
PART-A
PART-B
1. Write a recursive backtracking algorithm to find all the Hamiltonian cycles of a given graph.
2. Explain the n-Queens problem and trace it for n=6.Write the step by step process.
3. Suggest an approximation algorithm for travelling salesperson problem. Assume that the cost
function satisfies the triangle inequality.
4. Write an algorithm for subset sum and explain with an example.
5. Solve the following instance of knapsack problem by branch and bound
algorithm W=15.
ITE WEIG PROF
MS HT IT
1 5 40
2 7 35
3 2 18
4 4 4
5 5 10
6 1 2
2
a b
5 3
8
7
c 1 d
UNIT-5
PART-A
1. What are the factors that influence the efficiency of the backtracking
algorithm?
2. What is backtracking?
3. Define the Hamiltonian cycle.
4. What is the subset-sum problem?
5.When can a node be terminated in the subset-sum problem?
6. Give a template for a generic backtracking algorithm.
7. State m color-ability decision problem.
8. Define implicit constraint and explicit constraint.
9. Compared to backtracking and branch and bound?
10. What is state space tree?
PART-B