ADA - Question - Bank
ADA - Question - Bank
ADA - Question - Bank
7 Solve following knapsack problem using dynamic programming algorithm with given
capacity W=5, Weight and Value are as follows : (2,12),(1,10),(3,20),(2,15)
8 Explain: Acyclic Directed Graph, Articulation Point, Dense Graph, Breadth First Search
Traversal, Depth First Search Traversal.
9 Consider Knapsack capacity W=50, w=(10,20,40) and v=(60,80,100) find the maximum
profit using a greedy approach.
10 Find an optimal Huffman code for the following set of frequency. a : 50, b: 20, c: 15, d: 30.
11 Generate minimum spanning tree using Kruskal's algorithm for the following graph.
5 Solve all pair shortest path problem for the following graph using Floyd's algorithm.
6 Find all pair of shortest path using Floyd’s Algorithm for given graph
7 What is DFS? Explain with example. Show the ordering of vertices produced by Topological-
sort for the following graph.
8 Find out the Minimum Spanning Tree using Kruskal Algorithm for a given Graph.
Unit 7
1 Explain Backtracking Method. What is the N-Queens Problem? Give solution to 4- Queens
Problem using Backtracking Method.
2 Explain use of Branch & Bound Technique for solving Assignment Problem.
3 Explain Backtracking Method. What is the N-Queens Problem? Give solution to 4-Queens
Problem using Backtracking Method.
4 Differentiate branch and bound and backtracking algorithm.
5 Solve the following instance of knapsack problem using Backtracking Technique. The
Capacity of the Knapsack W = 8 and w = (2,3,4,5) and value v = (3,5,6,10)
6 Draw the state space tree Diagram for 4 Queen problem.
7 Write just steps for Backtracking and Branch-and-Bound algorithms.
Unit 8
1 What is a finite automata? Explain with example how a finite automaton is used for string
matching?
2 Explain spurious hits in Rabin-Karp string matching algorithm with example.Working
modulo q=13, how many spurious hits does the Rabin-Karp matcher encounter in the text T
= 2359023141526739921 when looking for the pattern P = 31415?
3 What is Finite Automata? Explain use of finite automata for string matching with suitable
example.
4 Explain naïve string matching algorithm with example.
5 Explain finite automata algorithm for string matching.
6 What is the string-matching problem? Define valid shift and invalid shift.
7 Write pseudo-code for Naïve-String-Matching algorithm.
Unit 9
1 Define P, NP, NP-Hard and NP-Complete Problem.
2 Explain in Brief: P Problem, NP Problem, NP Hard Problem, NP Complete Problem
3 Travelling Salesman Problem, Recurrence Equations, Relation, Approximation Algorithms.
4 What is Recursion? Give a Recursive algorithm for the Tower of Hanoi Problem and give
analysis of it.
5 What is recurrence? Explain recursion-tree method with suitable example.
6 Explain “P = NP ?” problem.
7 Explain travelling salesman problems. Prove that it is NP complete problem.
Prepared By
Prof. Kamlesh Singh
Asst. Prof. IT Dept.