You are on page 1of 4

Code: 9A05302

1
(Common to ECC, CSS, IT and CSE)

B.Tech II Year I Semester (R09) Regular & Supplementary Examinations December/January 2013/14 ADVANCED DATA STRUCTURES Time: 3 hours Answer any FIVE questions All questions carry equal marks ***** 1 (a) (b) 2 (a) (b) 3 (a) (b) 4 Explain exception handling mechanism. Write a note on: (i) Creating an object. (ii) Manipulating string objects. Write notes on stream classes. Explain the process of overloading various operators with examples. Write a recursive algorithm for a factorial function. Use an example. How you will implement conversion from infix to postfix using stacks? Explain. Develop a class for hash table using linear probing and never Used 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 never Used is true for every empty bucket. Explain HEAP SORT with example. Explain how a priority queue is represented with heap. Show the result of inserting 3, 1, 4, 6, 9, 2, 5, 7 into an initially empty binary search tree. Explain the logic involved in inserting an element into an AVL tree. Max Marks: 70

5 (a) (b) 6 (a) (b) 7

Describe the following: (a) Red-black tree. (b) Splay tree. (c) B-tree. What are compressed tries? Explain with one suitable example.

*****

Code: 9A05302

2
(Common to ECC, CSS, IT and CSE)

B.Tech II Year I Semester (R09) Regular & Supplementary Examinations December/January 2013/14 ADVANCED DATA STRUCTURES Time: 3 hours Answer any FIVE questions All questions carry equal marks ***** 1 (a) (b) 2 (a) (b) 3 (a) (b) Explain the concept of inline function with example. Write a C++ program to call a constructor recursively. Explain class templates. What is an abstract class? Explain with suitable example. Write an algorithm for implementation of pushing an element into a stack. Suppose a queue is maintained by a circular array QUEUE with N = 12 memory cells. Find the number of elements in the queue when: (i) FRONT = 4, REAR = 8 (ii) FRONT = 10, REAR = 3 (iii) FRONT = 5, REAR = 6 (iv) Delete two elements after step (iii). Explain in detail the hashing functions and collision handling techniques. Write a C++ program to insert n elements into a heap one by one. Write notes on external sorting. What is binary search tree? Write functions for insertion and deletion of a node in a BST. With suitable example, explain the operations on AVL tree. Explain the following: Sequential file organization. Indexed sequential file organization. With an example, describe Boyer-Moore algorithm for string-matching. What is the worst case running time? Max Marks: 70

4 5 (a) (b) 6 (a) (b) 7 (a) (b) 8

*****

Code: 9A05302

3
(Common to ECC, CSS, IT and CSE)

B.Tech II Year I Semester (R09) Regular & Supplementary Examinations December/January 2013/14 ADVANCED DATA STRUCTURES Time: 3 hours Answer any FIVE questions All questions carry equal marks ***** 1 (a) (b) 2 Write a C++ program to display the sum of odd numbers from 1 to 100. How is data hiding implemented in C++? How will you transfer values from derived class constructor to base class constructor? Explain with suitable illustration. Define ADTs. Implement circular linked list ADT. Write functions for push and pop operations of a stack. Consider inserting keys 20, 44, 62, 8, 30, 56, 34, 176, 118 in a hash-table of length m =11 using open addressing with the primary hash function. Illustrate the result of inserting these keys using linear probing, and double hashing. Write notes on extendible hashing. Write notes on priority queues. Write a C++ program to implement multi way merge sort algorithm. With an example, explain the algorithms of in order and post order traversals on a binary search tree. What is the height of AVL tree with n elements? How do you calculate it? Explain. How a red-black tree can be represented? What are the implementation considerations? Also find time complexity of red-black tree. Write notes on suffix trie. Write a C++ program to implement suffix trie. Max Marks: 70

3 (a) (b) 4 (a)

(b) 5 (a) (b) 6 (a) (b) 7

8 (a) (b)

*****

Code: 9A05302

4
(Common to ECC, CSS, IT and CSE)

B.Tech II Year I Semester (R09) Regular & Supplementary Examinations December/January 2013/14 ADVANCED DATA STRUCTURES Time: 3 hours Answer any FIVE questions All questions carry equal marks ***** 1 (a) (b) 2 (a) (b) 3 (a) Describe the basic concepts of object-oriented programming. Illustrate with an example, how the endl and setw manipulator works. Define inheritance. Explain various types of inheritance with examples. What is function overloading? How does compiler resolve invocation of overloaded functions? Write a function invert that invert the contents of stack in to another stack using stack operations. If original stack contains 1, 8, 5, 3 with 1 being most recently added item in the stack, the other stack after insert contains 3, 5, 8, 1 with 3 being item at the top of stack. Derive time complexity of quick sort algorithm. Explain the following: Extendible hashing. Double hashing. What is the role of a heap to implement a priority queue? Explain. Write notes on external sorting. Derive binary search tree ADT. Define height of a tree. How do you find height of an AVL tree? Write algorithm for it. What are top-down splay trees? Compare them with bottom-up splay trees. Compare the performance of following pattern matching algorithms: (a) Standard trie vs Suffix trie. (b) Compressed trie vs Suffix trie. Max Marks: 70

(b) 4 (a) (b) 5 (a) (b) 6 (a) (b) 7 8

*****

You might also like