Documente Academic
Documente Profesional
Documente Cultură
1. Explain set representation using trees and develop algorithms for UNION and
FIND using weighing and collapsing rules.
2.a) Write an algorithm sort N numbers in ascending order using Merge sort.
b) Calculate the time complexity of Merge sort.
5.a) Design a three stage system with device types D1, D2 and D3. The costs are
Rs.30, Rs.15 and Rs.20 respectively. 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.
b) Explain in detail the reliability design problem.
7. Write a program schema for a LIFO branch & bound search for a Least – cost
answer node.
8.a) Present a backtracking algorithm for solving the knapsack optimization problem
using the variable tuple size formulation.
b) Obtain a knapsack instance for which more nodes are generated by the
backtracking algorithm using a static tree than using a dynamic tree.
^^^
Set No.
Code No: 220502
II B.Tech. II-Semester Supplementary Examinations, November-2003
1. What is meant by time complexity? Give and explain different notations used
with examples.
3.a) Prove that Kruskal’s algorithm generates a minimum-cost spanning tree for every
connected undirected graph G.
b) Give an algorithm to assign program to tapes.
4.a) Find an optional binary search tree for a,b,….,h if the elements, in order, have
probabilities, 0.1,0.2,0.05,0.1,0.3,0.05,0.15,0.05 and all other elements have zero
probability.
b) Find an efficient data structure for representing a subset S of the integers from 1
to n. Operations we wish to perform on the set are:
1.Select an unspecified integer from the set and delete it.
2. Add an integer i to the set.
A mechanism must be provided to ignore a request to add integer i to S in the case
where S already contains i. The data structure must be such that the time to select
and delete an element and the time to add an element are constant and
independent of ||S||.
5.a) What do you mean by forward and backward approach of problem solving in
Dynamic Programming?
b) What are the differences between Greedy and dynamic programming method of
problem solving techniques?
6. Write and explain a non-recursive algorithm for inorder traversal of a binary tree
with an example. What is the time & space complexity of your algorithm?
7.a) Write LC branch & bound to find minimum cost answer node algorithm.
b) Write a program schema DFBB for a LIFO branch and bound search for a least
cost answer node.
^^^
Set No.
Code No: 220502
II B.Tech. II-Semester Supplementary Examinations, November-2003
3. Explain the Prims’ algorithm with an example. Analyze the time complexity of the
algorithm.
4. Show that an AVL tree of height h has at most 2h+1-1 vertices and at least vertices.
h h
5 + 2 5 1 + 2 5 5 − 2 5 1 − 5
−1
5 2 5 2
7.a) Draw the portion of the state space tree generated by LCKNAP for the knapsack
instances:
n=5, (P1,P2, ,P5) = (10,15,6,8,4), (w1 w2,...w5)=(4,6, 3, 4, 2) and M =12.
b) What do you mean by bounding? Explain how these bound are useful in branch
and bound methods?
8. A Polynomial of degree n > o has n derivatives, each one obtained by taking the
derivative of the previous one. Devise an algorithm which produces the values of
a polynomial & its n derivatives.
^^^ Set No.
Code No: 220502
II B.Tech. II-Semester Supplementary Examinations, November-2003
1. Given three sets {1,3,5,7},{2,4,8} and {6} in which n=8 with external names 1,2
and 3 respectively with the corresponding internal names 2,3 and 1. Write the data
structure for UNION-FIND algorithm using a linked list. Then write the data
structure after UNION instruction
2.a) Devise a binary search algorithm which splits the set not into 2 sets of equal sites
but into two sets one third and two thirds. How does this algorithm compare with
binary search?
b) Suggest refinements to Merge sort to make it in-place.
3. Explain the “Job Sequencing with dead line algorithm”, applying that find the
solution for the instance n=7, (P1 P2……P7) = (3, 5, 20, 18, 1, 6) and (d 1, d2……
d7) = (1, 3, 4, 3, 2, 1, 2).
4. Use an AVL tree as the basis of an algorithm ot execute MIN, UNION, and
DELETE on sets consisting of integers 1 through n, using O(log n) steps per
operation.
7. Present a program schema for a FIFO branch and bound search for a Least – Cost
answer node.
8. Explain in detail how the technique of backtracking can be applied to solve the 8-
queens problem. Present an algorithm for this and explain.
^^^