Professional Documents
Culture Documents
1
II B.Tech I Semester Supplementary Examinations, February 2007
ADVANCED DATA STRUCTURES & ALGORITHMS
( Common to Information Technology and Computer Science & Systems
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
⋆⋆⋆⋆⋆
1 of 1
Code No: R059211201 Set No. 2
II B.Tech I Semester Supplementary Examinations, February 2007
ADVANCED DATA STRUCTURES & ALGORITHMS
( Common to Information Technology and Computer Science & Systems
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
2. What do you mean by run time polymorphism and how to implement run time
polymorphism using virtual functions in C++? [16]
5. (a) Explain the linear probing method in Hashing? Explain its performance analy-
sis?
(b) What is hashing with Chains? Explain? Compare this with Linear Probing?
[8+8]
6. (a) Prove that the insertion of a new node in a red-black tree with n nodes in θ
(logn) time in the worst case.
(b) Derive the amortized complexity of a find, insert or delete operation performed
on a splay tree with n elements. [8+8]
7. (a) Explain the Binary tree in order traversal in o(n) and 0(1) space.
(b) Explain divide and conquer strategy by means of its control abstraction.
(c) What is the difference between Greedy method and Divide and conquer.
[6+6+4]
1 of 2
Code No: R059211201 Set No. 2
8. (a) What are the general characteristics of greedy algorithms and the problems
solved by these algorithms.
(b) What is 0/1 Knapsack problem? Explain how principle of optimality applies
to it. Also derive its dynamic recurrence relation. [8+8]
⋆⋆⋆⋆⋆
2 of 2
Code No: R059211201 Set No. 3
II B.Tech I Semester Supplementary Examinations, February 2007
ADVANCED DATA STRUCTURES & ALGORITHMS
( Common to Information Technology and Computer Science & Systems
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
2. Define Inheritance? How many types of inheritances are there? Explain each with
suitable examples. [16]
3. (a) How does that funky while (std :: cin >> foo) syntax work?
(b) Why does input seem to process past the end of file?
(c) Should we end output lines with std::endl or ‘\n′ ? [5+5+6]
5. Develop a class for hash table using linear probing and neverUsed concept to handle
an erase operation. Write complete C++ code for all the methods. Include a
method to reorganize the table when (say) 60% of the empty buckets have never
used equal to false. The reorganization should move pairs around as necessary and
leave a properly configured hash table in which neverUsed is true for every empty
bucket. [16]
6. (a) Write a method to delete the pair with the largest key from a Binary Search
Tree.
(b) Write a method to find the height of a Binary Search Tree? [8+8]
8. (a) Write a linear time algorithm that generates the OBST from the root table.
(b) Prove that the greedy method always obtains an optimal solution to the job-
sequencing problem. [8+8]
⋆⋆⋆⋆⋆
1 of 1
Code No: R059211201 Set No. 4
II B.Tech I Semester Supplementary Examinations, February 2007
ADVANCED DATA STRUCTURES & ALGORITHMS
( Common to Information Technology and Computer Science & Systems
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
5. (a) What is a dictionary? Define the abstract data type for it? Write the abstract
class for the dictionary?
(b) Give the applications of dictionary or dictionary with duplicates in which
sequential access is desired. [8+8]
6. What is a Binary search tree? Provide a specification for the abstract data type
BSTree(binary search tree with duplicates). Define a C++ abstract class that
corresponds to this ADT. Write a program to insert a pair into a binary search
tree. [16]
7. Write and explain a non recursive algorithm for post order traversal of a Binary
tree with an example. [16]
8. (a) Explain the Job sequencing with deadlines with an example using the greedy
approach.
1 of 2
Code No: R059211201 Set No. 4
(b) Describe the dynamic programming approach for the construction of OBST
for a set of n keys, if all keys are equally likely to be searched for. [8+8]
⋆⋆⋆⋆⋆
2 of 2