0% found this document useful (0 votes)
117 views5 pages

Question Bank Algorithm

The document is a comprehensive question bank covering various algorithms and data structures across five units. It includes definitions, explanations, and algorithms related to time complexity, searching algorithms, sorting methods, graph theory, dynamic programming, greedy algorithms, backtracking, and more. Each unit consists of multiple parts with specific questions aimed at assessing understanding and application of algorithmic concepts.

Uploaded by

KaleesWari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views5 pages

Question Bank Algorithm

The document is a comprehensive question bank covering various algorithms and data structures across five units. It includes definitions, explanations, and algorithms related to time complexity, searching algorithms, sorting methods, graph theory, dynamic programming, greedy algorithms, backtracking, and more. Each unit consists of multiple parts with specific questions aimed at assessing understanding and application of algorithmic concepts.

Uploaded by

KaleesWari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

ALGORITHM-QUESTION BANK

UNIT-1

PART-A

1. Define time complexity and space complexity of an algorithm.


2. List the types of asymptotic notations in analyzing complexity of algorithms.
3. Define the asymptotic notation “Big oh” (O).
4. What do you mean by algorithm?
5. Define linear search and binary search.
6. Define recurrence relation.
7. Give computing time for binary search.
8. Design an algorithm for computing area of circumference of the circle.
9. Define best, worst and average case time complexity
10. What are the properties of heap sort?

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

1. Outline the directed graph with example.


2. What is minimum spanning tree?
3. Define prim’s algorithm.
4. What is bipartite graph?
5. Define transitive closure of a directed graph.
6. Define the single source shortest path problem.
7. Give the Floyd’s algorithm.
8. What is weakly connected graph.
9. Define a graph.
10.What is mean by traversal and wirte the types of traversal.
PART-B
1. Write an algorithm for all pairs shortest path algorithm and what are the
time and space complexity of the algorithm.
2. (i) Explain depth first search on a graph with necessary data structures.
(ii) How do you construct a minimum spanning tree using Kruskals algorithm?
Explain?
3. Explain the Dijkstra’s shortest path algorithm and find the shortest path
between all vertices.

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

11.Give the general plan for divide-and-conquer algorithms.


12.List the Steps in Merge Sort
13.What is the time and space complexity of Merge sort?
14.Define dynamic programming.
15.Write the principle of optimality.
16.State the general principle of greedy algorithm.
17.What is the difference between dynamic programming and greed algorithm?
18.Define multistage graphs. Give an example.
19.Comment on merge pattern?
20.Define Optimization function?
PART-B

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.

3. Explain in detail quick sorting method. Provide a complete analysis of quick


sort.
4. Write the Huffman’s Algorithm. Construct the Huffman’s tree for the
following data and obtain its Huffman’s Code.
Characters A B C D E F
Probability 0.5 0.350.5 0.1 0.4 0.2
5. What is divide and conquer strategy and explain the binary search with suitable example problem.

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

1. Define Hamiltonian cycle.


2. What is the subset-sum problem?
3. Give a template for a generic backtracking algorithm.
4. State assignment problem.
5. What is state space tree?
6. Give the purpose of lower bound.
7. Wrote the formula for decision tree for searching a sorted array?
8. What are tractable and non-tractable problems?
9. How is lower bound found by problem reduction?
10. Give an example for sum-of-subset problem.

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

6. Explain the n-Queens problem and discuss the possible solutions.


Apply backtracking technique to solve the following instance of subset sum
problem: S= {1, 3, 4, and 5} and d=11.
7. What is Hamiltonian problem with example?
8. What is branch and bound? Explain in detail with suitable solutions.
9. Using backtracking, find the optimal solution to a knapsack problem for the
knapsack instance n=8,m=110,(p1….p7) = (11,21,3,1,33,43,53,55,65),
(w1….w7)=(1,11,21,33,43,53,55,65).
10. Apply branch and bound algorithm to solve the travelling salesman
problem.

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?

11. What is The Euclidean minimum spanning tree problem?


12. What is an articulation point in the graph?
13. What are tractable and non-tractable problems?
14. State the bin packing problem
15. Differentiate tractable and intractable problems.

PART-B

1. Explain the n-Queen’s problem & discuss the possible solutions.


2. Apply backtracking technique to solve the following instance of subset sum problem: S={1,3,4,5} and
d=11
3. Write a recursive backtracking algorithm to find all the Hamiltonian cycles of a given graph.
4. Describe the backtracking solution to solve 8-Queens problem.
5. With an example, explain Graph Coloring Algorithm.
6. Explain the control abstraction for Backtracking method. Describe the backtracking solution to solve
8-Queens problem.
7. Let w= {5, 7, 10, 12, 15, 18, 20} and m=35.Find all possible subset of w whose sum is
equivalent to m. Draw the portion of state space tree for this problem.
8. Using backtracking, find the optimal solution to a knapsack problem for the knapsack instance
n=8,m=110,(p1…p7)=(11,21,31,33,43,53,55,65)and (w1…w7)=(1,11,21,33,43,53,55,65).
9. (i) Give the backtracking algorithm for knapsack problem.
(ii) Explain elaborately recursive backtracking algorithm

You might also like