Code No: 07A60512
R07
Set No. 2
in
III B.Tech II Semester Examinations,Dec/Jan -2011/2012 DESIGNAND ANALYSIS OF ALGORITHMS DESIGN AND ANALYSIS OF ALGORITHMS Electronics And Computer Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Write an algorithm of LC branch and bound to find minimum cost answer node algorithm.
ld .
(b) Explain the solution to the traveling sales person problem by using LC branch and bound. [8+8] 2. (a) Solve the following recurrence relation: T(n) = 4T(n/2) + n2 ), where n > 1 and is a power of 2.
or
(b) What do you mean by the input size of a problem? Explain its significance. [10+6] 3. (a) Explain in detail about back tracking.
(b) Explain the Graph coloring with an example.
[8+8]
uW
4. (a) Consider the knapsack instance with 5 objects and a capacity M = 11, profits P = (5,4,7,2,3) and weights W = (4,3,6,2,2). Solve it using dynamic programming approach. (b) Explain the traveling sales person problem and solution using dynamic programming. [8+8] 5. (a) What is meant by Halting problem explain with an example. (b) Prove CNF satisfiability? Explain AND/OR graph decision problem.
[8+8]
Aj
nt
6. (a) Consider that there are three items weight and profit value of each item it as given below 1 wi pi 1 18 30 2 15 21 3 10 18 Also w = 20, obtain the solution for the above gives knapsack problem. (b) Show that prim’s algorithm can, like kruskal’s algorithm, be implemented using heaps. Show that it then takes a time in θ(a logn), where θ is the number of edges. [8+8]
7. Solve the following recurrence equation using substitution method. b if n < 3 (a) T (n) = 3T (n/3) + bn if n ≥ 3
1
Code No: 07A60512
R07
Set No. 2
(b) Translate algorithm maximum into a computationally equivalent procedure that uses no recursion. [8+8]
or
ld .
in
8. Find the Strongly connected components in the graph of figure 1.
Figure 1:
Aj
nt
uW
?????
2
Code No: 07A60512
R07
Set No. 4
1. (a) Explain the properties of strongly connected components?
[6+10]
ld .
(b) Write an algorithm for AND/OR Graphs.
in
III B.Tech II Semester Examinations,Dec/Jan -2011/2012 DESING ANDANALYSIS ANALYSIS OF DESIGN AND OFALGORITHMS ALGORITHMS Electronics And Computer Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ?????
2. (a) Compare and contrast between Brute force approach Vs Back tracking. (b) Suggest a solution for 8 queens problem .
[8+8]
3. (a) Describe in detail about the time and space complexity of an algorithm.
or
(b) Write an algorithm for multiplication of two matrices and analyse your algorithm. [10+6] 4. (a) Show that the job sequencing with dead lines problem is NP-hard. (b) Show that optimal code generation is NP-hard for leaf days on an infinite register machine.(Hint: Use FNS). [8+8]
uW
5. (a) Explain the strassen’s matrix multiplication
(b) Derive the time complexity for binary search.
[8+8]
6. (a) Find an optimal solution to the knapsack instance n = 7, m = 15, (p1, P2,......P7) = (10, 5, 15, 7, 6, 18, 3) and (w1, w2,......w7) = (2, 3, 5, 7, 1, 4, 1).
nt
(b) Write the control abstraction for the subset paradigm using greedy method. [8+8]
Aj
7. What is traveling sales person problem? Solve the following sales person problem instance using branch and bound. 0 10 15 20 5 0 9 10 6 13 0 12 8 8 9 0
8. Design a three stage system with device types D1, D2, D3. The costs of all devices are Rs. 30, Rs.15 and Rs 20.respectivesly. The cost of the system is to be no more than Rs.105. The reliability of each device type is 0.9, 0.8 and 0.5 respectively. [16] ?????
3
Code No: 07A60512
R07
Set No. 1
in
III B.Tech II Semester Examinations,Dec/Jan -2011/2012 DESING ANDANALYSIS ANALYSIS OF DESIGN AND OFALGORITHMS ALGORITHMS Electronics And Computer Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ?????
2. (a) Write short notes on i. Classes of NP-hard . ii. Classes of NP-complete. (b) How are P and NP problems related?
ld .
1. (a) Write the algorithm to calculate the upper bound u(.) and the cost of each Cˆ node (.) (b) Explain in detail about LIFO branch and Bound. [8+8]
[8+8]
or
3. (a) By the approach of dynamic programming, Explain the solution for all pairs shortest path problem with an example. (b) Describe the merging and purging rules in 0/1 knapsack problem. [10+6]
uW
4. W={5, 10, 12, 13, 15, 18} m=30. Find all possible subsets of w that sum to m. Draw the portion of state space tree that is generated. [16] 5. (a) Write an algorithm for Iterative binary search (b) Prove by induction the relationship E=I+2n for a binary tree with n internal nodes. The variables E and I are the external and internal path length, respectively. [8+8]
nt
6. (a) Explain how we can identify connected components of a graph by using depth first search (b) Explain the properties of Bi - connected components. [8+8]
Aj
7. (a) Show that if n mod (k-1) = 1, then the greedy rule generates any optimal k-ary merge tree for all (q1, q2,.......qn). (b) Draw the optimal three-way merge tree when (q1, q2,......q11) = (3, 7, 8, 9, 15, 16, 18, 20, 23, 25, 28). [8+8] 8. (a) Solve the ( following recurrence exactly 1 if n = 0 or n = 1 T (n) = q 1 2 1 2 T (n − 1) + 2 T (n − 2) + n otherwise 2 (b) The Fibonacci numbers are defined as fo=0, f1 =1 and f i = fi−1 +fi−2 f or i > 1. Write both recursive and an iterative algorithm to compute fi . [8+8] ????? 4
Code No: 07A60512
R07
Set No. 3
in
III B.Tech II Semester Examinations,Dec/Jan -2011/2012 DESING ANDANALYSIS ANALYSIS OF DESIGN AND OFALGORITHMS ALGORITHMS Electronics And Computer Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Derive the Bounding functions of sum of subsets problem and write the algorithm for the same.
[10+6]
ld .
(b) Define the following terms: live node, E-node, dead node.
2. (a) Compute 2102*1130 by applying divide and conquer method.
(b) Write the algorithm to find the maximum and the minimum element from a list using divide and conquer strategy. [8+8]
Aj
nt
uW
or
3. (a) Apply Kruskal’s algorithm to find minimum spanning tree of the following graph of figure 3. [16]
Figure 3:
(b) Analyze the time and space complexity of Prims algorithm.
[10+6]
4. Prove that a cross edge in a BFS tree of undirected graph can connect vertices only on either the same level or on two adjacent levels of BFS tree. [16] 5. Show that the HAMILTONIAN CYCLE problem on directed graphs is NP-complete. [16]
5
Code No: 07A60512
R07
Set No. 3
6. (a) How can we modify the dynamic programming algorithm from simply computing the best benefit value for the 0-1 knapsack problem to computing the assignment that gives this benefit? [8+8]
Figure 6:
ld .
in
(b) Compute all pair shortest paths for the following graph of figure 6.
uW
or
7. Solve the TSP problem having the following cost-matrix using branch-and-bound A B C D X 5 2 3 A [16] technique. B 4 X 1 5 . 4 2 X 3 C 7 6 8 X D 8. (a) Use the most appropriate notation among O, θ, Ω to indicate the time efficiency of sequential search in worst, average and best case.
(b) Order the following function according to their order of growth (from the low√ est to the highest). (n − 2)!, 5log(n + 100)10 , 22n , 0.001n4 +3n3 +1, 1n2 n, , 3 n, 3n [8+8]
Aj
nt
?????
6