Sei sulla pagina 1di 4

Code No: R7210503 1

II B.Tech I Semester(R07) Supplementary Examinations, May 2009


ADVANCED DATA STRUCTURES
(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) Define inheritance? Explain about the access control mechanism in Inheritance in C++?
(b) Write a program to illustrate the concept of hierarchical Inheritance? [8+8]

3. (a) Explain about ios flags in C++ with suitable program.


(b) Explain about the manipulators in C++. [8+8]

4. (a) What is a Sparse Matrix? Explain about the linear list representation of a sparse matrix?
(b) Write a C++ program to implement addition of two sparse matrices? [8+8]

5. (a) What is skip list representation of dictionary? Write the structure to represent node in a
skip list. What are the data members to be included in the class skipList.
(b) Write a method in C++ to search a skip list and save the last node encountered at each
level. [8+8]

6. Define an AVL tree? Write the procedures to perform insertion, deletion in an AVL tree? [16]

7. (a) Describe the B-trees? Explain the advantages of B-trees.


(b) Prove that let T be a red black tree with n interval nodes then no node has depth greater
than 2 log(n+1). [8+8]

8. (a) Explain the boyar Moore algorithm with an example


(b) What are the advantages and disadvantages of tries with respect to binary search tree.
[10+6]

?????
Code No: R7210503 2
II B.Tech I Semester(R07) Supplementary Examinations, May 2009
ADVANCED DATA STRUCTURES
(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) What is a class? How do you define class in C++?


(b) Explain about the data members and member functions of a class?
(c) Explain about access control mechanism in C++? [5+5+6]

2. (a) Explain about operator overloading? Explain the rules to be followed on overloading the
operators?
(b) Explain about the function overriding with suitable examples. [8+8]

3. (a) Why should we use iostream instead of the traditional cstdio?


(b) Why does a program go into an infinite loop when someone enters an invalid input char-
acter?
(c) How can we get std::cin to skip invalid input characters? [5+6+5]

4. Write code for a method reverse which reverses the order of the elements in the list. Do the
reversal in place and do not allocate any new nodes. [16]

5. What is Hashing? Explain the different Hash table representations in detail? [16]

6. (a) What is an AVL search tree? How do we define the height of it? Explain about the
balancef actor associated with a node of an AVL tree.
(b) Explain how an AVL tree can be used to sort a sequence of n elements in O (n log n) time.
[8+8]

7. (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]

8. (a) Explain the brute force algorithm with an example


(b) Draw the compact representation of the suffix tire for the string “minimize minima”.[8+8]

?????
Code No: R7210503 3
II B.Tech I Semester(R07) Supplementary Examinations, May 2009
ADVANCED DATA STRUCTURES
(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) When are temporary variables created by C++ compiler?


(b) What is a local class? Why can it be useful?
(c) Can a copy constructor accept an object of the same class as parameter, instead of reference
of the object?
(d) What is a class? [4+4+4+4]

2. What is template? Explain about function templates and class templates with suitable exam-
ples. [16]

3. (a) What are some ways try / catch / throw can improve software quality?
(b) How can we handle a constructor that fails?
(c) How can we handle a destructor that fails. [5+5+6]

4. (a) Define a sparse matrix? Explain its representation? Write the program that gives the
header for the class sparse Matrix which uses row major mapping of a sparse matrix into
an arrayList.
(b) Write the methods get (theRow, the Column) and set (theRow, theColumn, the-
Value) for a sparse matrix. [10+6]

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. (a) What is a Splay tree? What is a splay node?


(b) Explain one level and two level splay steps in a Splay tree with appropriate examples?[16]

7. (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]

8. (a) Explain the brute force algorithm with an example


(b) Draw the compact representation of the suffix tire for the string “minimize minima”.[8+8]

?????
Code No: R7210503 4
II B.Tech I Semester(R07) Supplementary Examinations, May 2009
ADVANCED DATA STRUCTURES
(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) What do you mean by Stack unwinding?


(b) What is the difference between const char ∗myPointer and char ∗const
(c) Define precondition and post-condition to a member function.
(d) What are the conditions that have to be met for a condition to be an invariant of the
class? [4+4+4+4]

2. (a) Explain about operator overloading? Explain the rules to be followed on overloading the
operators?
(b) Explain about the function overriding with suitable examples. [8+8]

3. What is the difference between the C++ standard library, and the C++ standard template
library? [16]

4. Write a C++ program to determine whether or not a character string has an unmatched
parenthesis? [16]

5. (a) What is the structure to represent node in a skip list. Write the constructor for skipList.
(b) Write a method in C++ to find a pair with key theKey in a dictionary using skip list
representation? What is its complexity? [8+8]

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]

7. (a) Describe the B-trees? Explain the advantages of B-trees.


(b) Prove that let T be a red black tree with n interval nodes then no node has depth greater
than 2 log(n+1). [8+8]

8. (a) Explain the construction of the kmp flow chart with an example.
(b) Explain the search engines. [10+6]

?????

Potrebbero piacerti anche