DAA Important Questions
DAA Important Questions
MODULE – 1
MODULE – 2
1. Explain divide and conquer technique with general algorithm. (6)
2. Compare the straightforward method and divide and conquer method of finding maximum and minimum
elements of the list. (8)
(OR) Give the recursive algorithm to find maximum and minimum element from the list (10)
3. Write Merge sort algorithm for sorting using divide and conquer. (6)
(OR) Write merge sort algorithm with example, also calculate the efficiency. (12)
(OR) Design an algorithm for performing merge sort. Analyze its time efficiency. Apply the same to
sort the following set of numbers 4, 9, 0, -1, 6, 8, 9, 2, 3, 12 (10)
4. Sort the following keyword “ALGORITHM” by applying Quick sort method. (6)
(OR) Write quick sort algorithm with example, also calculate the efficiency. (12)
(OR) Design an algorithm for performing quick sort. Apply the same to sort the following set of
numbers 5, 3, 1, 9, 8, 2, 4, 7 (10)
(OR) Apply both mergesort and quicksort algorithm to sort the character’s VTUBELAGAVI. (10)
5. Apply topological sorting algorithm for the following graph, shown in figure and find the topological
sequence? (6)
(OR) Apply topological sort on the following graph using source removal and DFS based method (10)
(OR) Obtain the topological sort for the graph using i) source removal method ii) DFS method (10)
MODULE – 3
1. Find the optimal solution using greedy for the job sequencing with deadline problem with following
values? n = 5. (6)
Profit = {10, 3, 33, 11, 40}
Dead line = {3, 1, 1, 2, 2}
2. Explained coin change problem with example. (6)
3. Apply greedy method to obtain an optimal solution to the knapsack problem given M = 60. (4)
W = {5, 10, 20, 30, 40}
P = {30, 20, 100, 90, 160} Find total profit earned.
(OR) Write an algorithm to solve the Knapsack problem using greedy approach and apply the same
to find an optimal solution to the knapsack instance n =5, m = 6 (10) (IMP)
(OR) Explain greedy knapsack problem with example. (8)
4. Find the optimal solution for the Greedy job sequencing problem, given n = 4 , profits [10, 30, 60, 40],
deadlines [2, 3, 1, 3]. (5)
5. Apply the Prim’s algorithm to obtain minimum cost spanning tree for the given weighted connected
graph? (6)
(OR) Define minimum spanning tree. Write Prim’s algorithm to find a minimum spanning tree.
Apply the same on the following graph: (10)
6. Apply Prims and Kruskal’s algorithm to find the minimum cost spanning tree for the graph given in fig:
(6)
7. Write an algorithm for minimum spanning tree using Prim’s and Kruskal’s (8) + (8)
8. Apply single source shortest path algorithm to the following graph. Assume vertex ‘a’ as source (8)
(OR) What is Dijkstra’s algorithm used for? Apply Dijkstra’s algorithm on the following graph. Initial
node is G
(10)
9. Construct the Huffman tree and resulting code word for the following set of values? (8)
(OR)
(OR)
MODULE – 4
1. Explain multistage graph with an example. Write backward multistage graph algorithm. (10)
(OR) Define a multistage graph. Give an example. Explain the technique of finding the minimum cost
path in a multistage graph. (10)
2. Apply Warshall’s algorithm to find the transitive closure of the following graph shown in the figure (10)
(OR) Define transitive closure of a directed graph, write Warshall’s algorithm to find transitive
closure. Apply the same to find transitive closure of the digraph given below the figure. (10)
(OR) Explain transitive closure of a directed graph and find the transitive closure for the given graph
3. Apply Floyd’s algorithm to solve all pair shortest path for the given graph (10)
(OR) Design an algorithm to find all pairs of shortest paths given a weighted connected path using
dynamic programming technique. Apply the same algorithm to compute all pairs of shortage paths
for the following weighted connected graph. (10)
(OR) Apply Floyd’s algorithm to find the all-pairs shortest path for the given adjacency matrix. (10)
4. Apply dynamic programming approach to solve the given travelling salesman problem. (10)
(OR) Solve the following travelling sales person problem using dynamic programming technique
5. Design an algorithm to solve knapsack problem using dynamic programming. Apply the same to solve
following knapsack problem where W = 50. (10)
(OR) Solve the instance of 0/1 knapsack problem using dynamic programming approach. (10) (IMP)
MODULE – 5
1. What is backtracking list out to advantages of backtracking strategy. Considering 4-Queens problem,
provide two possible solutions to this problem using backtracking technique. (10)
(OR) With the help of state space tree, solves the 4- Queens problem by using backtracking approach.
(OR) Explain N-Queen problem with example. (10)
2. Apply backtracking method to solve sum of subset problem for the instance. D = 30, S = {5, 10, 12, 13,
15, 18}. Give all possible solution with state space for construction. (10)
3. Color the regions in the map given in the figure by applying backtracking graph color algorithm.
Color = ( R G B & Y ).
4. Find a Hamiltonian circuit for the following graph, shown in figure using backtracking technique. (10)
6. Solve the travelling sales person problem using branch and bound technique. (10)
7. Apply branch and bound method for knapsack problem C = 10. (10) (IMP)