VIGNAN INSTITUTE OF TECHNOLOGY AND SCIENCE Department of CSE Question Bank Design and Analysis of Algorithms III B. Tech.-I- Semester UNIT-I s.no QUESTIONS Marks PO CO BTL 1.a) List the asymptotic notations. 2M 1 C212.1 1 b) Solve that if f(n) = amnm + …..+ a1n + a0 then f(n) = O( nm ). 3M 2 C212.1 3 c) i) Write and explain the control abstraction for Divide and conquer. 6+4 M 3 C212.1 2 ii) Explain the theta notation used in algorithm analysis 2.a) Define the time complexity. 2M 1 C212.1 1 b) Analyze the time complexity of merge sort 3M 2 C212.1 4 c) i) Discuss about space complexity in detail. 5+5 M 2 C212.1 2 2 C212.1 3M 2 C212.1 4 6+4 M 2 C212.1 3 ii) Write an algorithm for quick sort. Explain with an example. 3.a) b) c) Arrange the following functions in ascending order (n, 2M log n,n2,n3,nlogn,2n ) Analyze the time complexity of quick sort. i) Apply quick sort technique and arrange the records with the following index values in the ascending order. 2, 3, 8, 5, 4, 7, 6, 9, 1 ii) Write the recurrence relation for the quick sort and derive its time complexity. 4.a) Evaluate order of growth? 2M 1 C212.1 6 b) List out the reasons for the difficulties that one faces while determining the lower bound 3M 1 C212.1 1 c) i) What is an algorithm? Explain its characteristics. 5+5 M 1 C212.1 2 ii) Explain the Strassen’s matrix multiplication. 5.a) Define Space Complexity. 2M 1 C212.1 1 b) Calculate the best case, worst case, average case time complexities of Binary Search. 3M 2 C212.1 4 c) i) Construct the quick sort algorithm to sort the list C, O, L, L, E, G, E in alphabetical order. 5+5 M 3 C212.1 5 ii) Solve the following recurrence: T(n)=4T(n/2)+n, Where 1n and is a power of 2. 6.a) List out algorithm properties. 2M 1 C212.1 1 b) Analyze the time complexity of Strassens matrix multiplication. 3M 2 C212.1 4 c) i) Write the non-recursive algorithm for finding the Fibonacci sequence and define its time complexity. 5+5 M 3 C212.1 3 ii) Apply the following recurrence equation: [5+5] T(n): T(n)= 1 = T(n-1)+nn if n==1 otherwise 7.a) Write an Algorithm for merge sort. Explain with example 8M 1 C212.1 2 b) Write an Algorithm for Binary Search. Explain with Example. 7M 1 C212.1 2 UNIT-II s.no QUESTIONS Marks PO CO BTL 1.a) What is Hamiltonian cycle? 2M 1 C212.2 1 b) Explain the properties of strongly connected components. 3M 1 C212.2 2 c) i) What is weighting rule for Union(i,j)? How it improves the performance of union operation? 6+4 M 2 C212.2 2 Ii) What is biconnected graph? 2.a) What is AND/OR graph? 2M 1 C212.2 1 b) What is sum of subsets problem? 3M 1 C212.2 1 c) i) Explain the Find algorithm with collapsing rule is spanning tree? 6+4 M 1 C212.2 2 3.a) List the Applications of Backtracking 2M 1 C212.2 1 b) Define articulation point? 3M 1 C212.2 1 c) i) Describe Backtracking technique to m-coloring graph. 5+5 M 1 C212.2 2 II) What ii) Briefly explain n-queen problem using backtracking. 4.a) Write an algorithm of simple union. 2M 1 C212.2 2 b) Find the sum of subsets for the following set of integers using fixed tuple method. {5, 10, 25, 50,100} for W=75. 3M 2 C212.2 1 c) i) Explain the 4-queen problem using backtracking. 5+5 M 1 C212.2 2 II) Draw the state space tree for m-coloring graph. 5.a) Define state space tree? 2M 1 C212.2 1 b) Define graph coloring problem? 3M 1 C212.2 1 c) i) Write an algorithm for AND/OR Graphs. 5+5 M 1 C212.2 2 ii) Describe Union and Find algorithms. 6.a) Define connected components? 2M 1 C212.2 1 b) Write about Bi-Connected components. 3M 1 C212.2 1 c) i) Explain Backtracking general method. 5+5 M 1 C212.2 2 II) Write an Algorithm to find the strongly connected components in diagraph. UNIT-III s.no QUESTIONS Marks PO CO BTL 1.a) Give brief description on greedy method. 2M 1 C212.3 1 b) Construct control abstraction Algorithm of Greedy method. 3M 1 C212.3 5 c) i) Apply greedy algorithm to the job sequencing with deadlines. 5+5 M 2 C212.3 3 ii) Define merging and purging rules in 0/1 knapsack problem. 2.a) Write an algorithm of greedy knapsack. 2M 1 C212.3 1 b) Define Job sequencing with deadline problem 3M 1 C212.3 1 c) i) Differentiate between greedy method and dynamic programming. 5+5M 2 C212.3 3 ii)Demonstrate Kruskal’s algorithm with an example. 3.a) Define feasible Solution? 2M 1 C212.3 1 b) Define minimum cost spanning tree. 3M 1 C212.3 1 c) i)Discuss about fractional Knapsack problem? Consider the following instance of knapsack problem n=3, m=20, profits (p1,p2,p3)=(25,24,15) and weights (w1,w2,w3)=(18,15,10). Obtain the optimal solution using Greedy approach. 5+5 M 2 C212.3 2 1 C212.3 1 C212.3 1 ii) Explain the Prim’s Algorithm with an example. 4.a) Define optimal Solution? 2M b) Define 0/1 Knapsack problem. 3M c) Write an Algorithm for single source shortest path and explain with an example 10 M 1 C212.3 1 5.a) Define knapsack problem? 2M 1 C212.3 1 b) Write high level description for job sequencing Algorithm. 3M 1 C212.3 2 c) Explain Greedy Algorithm for Job Sequencing with deadline problem. 10 M 2 C212.3 2 6.a) What is Single Source Shortest Problem? 2M 1 C212.3 1 b) What is multistage graph? 3M 1 C212.3 1 c) i) Apply Greedy algorithm for Single Source Shortest Problem. 5+5 M 2 C212.3 3 ii) For given instances of job sequencing with deadline problem. n=5, (p1,…….,p5)=(20,15,10,5,1) and deadlines (d1,….,d5)=(2,2,1,3,3) Obtain the optimal solution. Unit-IV s.no QUESTIONS Marks PO CO BTL 1.a) Give brief description on Dynamic Programming. 2M 1 C212.4 1 b) Write control abstraction Algorithm of Dynamic Programming 3M 1 C212.4 1 c) Explain merging and purging rules in 0/1 knapsack problem.And Write 0/1 Knapsack informal Algorithm 5+5 M 2 C212.4 2 2.a) Define All pairs shortest path Problem? 2M 1 C212.4 1 b) Differentiate between greedy method and dynamic programming. 3M 1 C212.4 2 c) Given Knapsack Instance n=3, (w1,w2, w3)=(2,3,4), (p1,p2,p3)=(1,2,5) and m=6, construct ordered set and find the x1,x2,x3 values 5+5M 2 C212.4 1 3.a) What is the Principle of Optimality? 2M 1 C212.4 1 b) Differentiate between Divide & Conquer and dynamic programming. 3M 1 C212.4 2 c) Discuss about all pairs shortest path problem with suitable example 5+5 M 2 C212.4 2 4.a) Define optimal Solution? 2M 1 C212.4 1 b) Define 0/1 Knapsack problem 3M 1 C212.4 1 c) Explain about Optimal binary search trees. Consider n=4 and (q1,q2,q3,q4)=(do,if,int,while).The values for p’s and q’s are given as p(1:4)=(3,3,1,1) And q(1:4)=(2,3,1,1,1). Construct the OBST. 10 M 2 C212.4 2 5.a) What do you mean by optimal binary search tree? 2M 1 C212.4 1 b) Give the algorithm for all pairs shortest path problem. 3M 1 C212.4 1 c) Explain about OBST general solution with an example and derive formulas for constructing OBST using dynamic programming method 10 M 2 C212.4 2 6.a) List the applications of Dynamic programming? 2M 1 C212.4 1 b) Explain briefly about Optimization problem? 3M 1 C212.4 2 c) Write OBST algorithm . 5+5 M 2 C212.4 1 Unit-V s.no QUESTIONS Marks PO CO BTL 1.a) What do you mean by bounding? 2M 1 C212.5 1 b) Write about the general method for Branch and Bound. 3M 1 C212.5 1 c) Explain about 0/1 Knapsack problem in branch and bound. 5+5 M 2 C212.5 2 2.a) Write the applications of Branch and Bound problem. 2M 1 C212.5 1 b) Write the control abstraction algorithm for LC search. 3M 1 C212.5 1 c) Draw the portion of the state space tree generated by LCBB for the following instances: n=5, m=12, (P1 ……….. P5) = (10, 15, 6, 8, 4) (w1 ………… w5) = (4, 6, 3, 4, 2) 5+5M 3 C212.5 2 3.a) What is the Principle of Optimality? 2M 1 C212.5 1 b) Write the non-deterministic sorting algorithm. 3M 1 C212.5 2 c) Explain about Traveling sales problem in branch and bound. 5+5 M 2 C212.5 2 4.a) What is meant by non-deterministic algorithm? 2M 1 C212.5 1 b) What is the relation between NP-hard and NP-complete? 3M 1 C212.5 1 c) i) Write a short notes on Clique problem. 10 M 1 C212.5 2 ii) Write a short notes on 3-SAT Problem. 5.a) Define Class P? 2M 1 C212.5 1 b) What is NP-hard problem. 3M 1 C212.5 1 c) i) Show that the HAMILTONIAN CYCLE problem on directed graphs is NP complete. 10 M 2 C212.5 2 ii) State the cook’s theorem. What is the significance of this theorem?. 6.a) List the applications of Dynamic programming? 2M 1 C212.5 1 b) Distinguish between deterministic and non deterministic algorithm. 3M 2 C212.5 2 c) i) Prove that CNF satisfiability of AND/OR graph decision problem. 5+5 M 2 C212.5 2 ii) Explain the classes of NP-hard and NP-complete.