This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

Editors' Picks Books

Hand-picked favorites from

our editors

our editors

Editors' Picks Audiobooks

Hand-picked favorites from

our editors

our editors

Editors' Picks Comics

Hand-picked favorites from

our editors

our editors

Editors' Picks Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

Set No. 1

II B.Tech I Semester Supplimentary Examinations, February 2008 ADVANCED DATA STRUCTURES AND 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. (a) What is a friend function? Explain the advantages and disadvantages of it? (b) What is static member function? Explain it’s limitations. [8+8]

2. (a) Explain the concept of virtual functions in C++ with suitable examples. (b) Explain the concept of operator overloading in C++. [8+8]

3. (a) Write a program to replace all the occurrences of a word with some other word in a given ﬁle. (b) Write a program to check whether the given string is palindrome or not. [8+8] 4. Write an algorithm for transposing a given matrix of n × m size and determine the time complexity of the algorithm by using Asymptotic notation method. [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 ﬁnd a pair with key theKey in a dictionary using skip list representation? What is its complexity? [8+8] 6. What is an AVL Tree? Explain about the diﬀerent rotation patterns in AVL trees for balancing with appropriate examples? [16] 7. (a) Find a necessary and suﬃcient condition for the root of a depth ﬁrst search for a connected graph to be an articulation point. (b) Solve the following recurrence relation using substitution method T(n) = 1 where n <= 4 √ where n > 4 = 2T ( n) +logn [8+8]

8. (a) If objects are selected in order of decreasing Vi /Wi then prove that the algorithm Knapsack ﬁnds an optimal solution. (b) Explain the Optimal binary search tree. ⋆⋆⋆⋆⋆ [8+8]

1 of 1

Code No: R059211201

Set No. 2

II B.Tech I Semester Supplimentary Examinations, February 2008 ADVANCED DATA STRUCTURES AND 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. (a) (b) (c) (d) What do you mean by Data abstraction? Diﬀerence between “C structure” and “C++ structure”. Diﬀrence between a “assignment operator” and a “copy constructor”. What is the diﬀerence between ?overloading? and “overridding”? [4+4+4+4] [8+8]

2. (a) Explain the need for “Virtual Destructor”. (b) Can we have “Virtual Constructors”?

3. (a) What does throw; (without an exception object after the throw keyword) mean? Where would we use it? (b) How do we throw polymorphically? (c) When we throw this object, how many times will it be copied? [5+5+6] 4. (a) Discuss brieﬂy the asymptotic notations used for ﬁnding the complexity of Algorithms. (b) Write a C++ program to implement the sparse matrix. [8+8] 5. Deﬁne the abstract class for dictionary? Write the methods f ind, insert, erase used in dictionary? Explain the time complexities to perform above three operations? [16] 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 ﬁnd, insert or delete operation performed on a splay tree with n elements. [8+8] 7. (a) Find a necessary and suﬃcient condition for the root of a depth ﬁrst search for a connected graph to be an articulation point. (b) Solve the following recurrence relation using substitution method [8+8] T(n) = 1 where n <= 4 √ = 2T ( n) +logn where n > 4 8. (a) Show how Prim’s algorithm can be implemented using heap. What would be the time complexity of the algorithm. (b) What is the time complexity of traveling sales person problem using dynamic programming. [10+6] ⋆⋆⋆⋆⋆ 1 of 1

Code No: R059211201

Set No. 3

II B.Tech I Semester Supplimentary Examinations, February 2008 ADVANCED DATA STRUCTURES AND 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. (a) Explain about the dynamic memory allocation and de-allocation in C++. (b) Explain about static inner classes with a program. 2. Explain the diﬀerence between virtual function and virtual inheritance. 3. (a) Why should we use iostream instead of the traditional cstdio? (b) Why does a program go into an inﬁnite loop when someone enters an invalid input character? (c) How can we get std::cin to skip invalid input characters? 4. (a) What is meat by Proﬁling ? Explain it with an example. (b) Trace the heap sort algorithm to sort the following list of numbers 8, 20, 9, 4, 15, 10, 7, 22, 3, 12. [8+8] [5+6+5] [8+8] [16]

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 conﬁgured hash table in which neverUsed is true for every empty bucket. [16] 6. Deﬁne a Binary Search Tree? Write the procedures to perform insertion, deletion and searching in a binary search tree? [16] 7. (a) Show that depth ﬁrst search can be used to ﬁnd the connected components of an undirected graph. (b) Write the Quick sort algorithm Also analyze its time complexity in Best case. [6+10] 8. (a) Solve the following 0/1 Knapsack Problem using dynamic programming n=4, m=30, (w1 , w2 , w3 , w4 ) = (10,15,6,9) and (p1 , p2 , p3 , p4 ) = (2,5,8,1). (b) Diﬀerentiate between Greedy method and Dynamic Programming ⋆⋆⋆⋆⋆ [8+8]

1 of 1

Code No: R059211201

Set No. 4

II B.Tech I Semester Supplimentary Examinations, February 2008 ADVANCED DATA STRUCTURES AND 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. (a) Explain about the static variable? (b) Explain about the static functions and static classes in detail with a program. [8+8] 2. (a) What special considerations do we need to know about when I use Virtual Inheritance? (b) What special considerations do we need to know about when I inherit from a class that uses virtual inheritance? (c) What special considerations do I need to know about when I use a class that uses virtual inheritance? [5+5+6] 3. (a) What does throw; (without an exception object after the throw keyword) mean? Where would we use it? (b) How do we throw polymorphically? (c) When we throw this object, how many times will it be copied? 4. (a) What is a heap ? Diﬀerentiate between heap and binary search tree. (b) Show that log 3 n is O(n1/3 ). (c) Brieﬂy explain about Hashing. [5+5+6] [5+5+6]

5. (a) Explain the linear probing method in Hashing? Explain its performance analysis? (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 ﬁnd, insert or delete operation performed on a splay tree with n elements. [8+8] 7. Prove the equation T( N ) + a T ( N /b ) + θ(N k log p N ) Where a≥1, b≥1 and P≥0 is T(N) = O(Nlog a)ifa > bk b O (Nk logp+1 N) if a = bk O(Nk logp N) if a < bk . 1 of 2 [16]

Code No: R059211201

Set No. 4

8. (a) Show how Prim’s algorithm can be implemented using heap. What would be the time complexity of the algorithm. (b) What is the time complexity of traveling sales person problem using dynamic programming. [10+6] ⋆⋆⋆⋆⋆

2 of 2

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd