Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
II B.Tech I Semester Supplimentary Examinations, February 2008
ADVANCED DATA STRUCTURE
( Common to Computer Science & Engineering and Electronics &
Computer Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
------------------------------------------------------------------------
1. (a) Each class has some special member-functions, which calls can be inserted by the compiler into a
code without explicit instruction of the programmer. Enumerate such functions, members and cases, when
implicit calls can arise.
(b) If when creating a variable the programmer explicitly did not initialize it, in
some cases, the compiler itself would give it a certain, predefined initial value,
and in some cases the initial value would be unpredictable. What does it
depend on? [8+8]
2. (a) When should my destructor be virtual?
(b) What is a “virtual constructor”?
(c) What’s the difference between how virtual and non-virtual member functions
are called? [5+5+6]
3. (a) Explain about try, catch, throw keywords in C++?
(b) Write a program to illustrate the exception handling mechanism in C++.
[8+8]
4. (a) What is a linked list / chain. Write the class header for the class chain
(b) Write the program which gives the Constructor and copy constructor for chain. [8+8]
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. What is an AVL Tree? Explain about the different rotation patterns in AVL trees for balancing with
appropriate examples? [16]
7. What is balanced search tree? Describe different types of balanced search trees with an example. [16]
8. (a) Explain the compressed trie with an example.
(b) How will the KMP algorithms behave if the pattern and/or the text are null
(have length zero)? Will they ”crash”? if not, will their output be meaningful
and correct. [8+8]
?????
Set No. 2