JNTU II B.Tech I Semester Supplimentary Examinations, November 2008
ADVANCED DATA STRUCTURE
( Common to Computer Science & Engineering and Electronics &
1. (a) What is a friend function? Explain the advantages and disadvantages of it?
(b) What is static member function? Explain it’s limitations.
2. (a) What is Hybrid inheritance? Write a program to illustrate the concept of Hybrid Inheritance.
(b) What is single inheritance? Write a program to illustrate the concept of single Inheritance. [
3. (a) Explain about try, catch, throw keywords in C++?
(b) Write a program to illustrate the exception handling mechanism in C++.
4. What is a linked list / chain.. Write the program which gives the constructor and destructor for chain.
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.
6. (a) What is a Binary search tree? Define a C++ abstract class that corresponds to this ADT.
(b) Write a method to search for an element of a Binary Search Tree? What is its time complexity?
7. (a) Write deletion algorithm of red black tree.
(b) Describe the operations of Splay tree.
8. Give the fail indexes used by the KMP algorithm for the following patterns.