Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
13Activity
0 of .
Results for:
No results containing your search query
P. 1
r059211201 Advanced Data Structures and Algorithms

r059211201 Advanced Data Structures and Algorithms

Ratings:

4.0

(1)
|Views: 1,120|Likes:
Published by SRINIVASA RAO GANTA

More info:

Published by: SRINIVASA RAO GANTA on Aug 21, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

02/03/2013

pdf

text

original

Code No: R059211201
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
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6
1. (a) What is a friend function? Explain the advantages and disadvantages of it?
(b) What is static member function? Explain it\u2019s 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 \ufb01le.
(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\u00d7 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 \ufb01nd 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\ufb00erent rotation patterns in AVL trees
for balancing with appropriate examples?
[16]
7. (a) Find a necessary and su\ufb03cient condition for the root of a depth \ufb01rst 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 (\u221an) +logn
where n> 4
8. (a) If objects are selected in order of decreasingVi/Wi then prove that the algo-
rithm Knapsack \ufb01nds an optimal solution.
(b) Explain the Optimal binary search tree.
[8+8]
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6
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
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6

1. (a) What do you mean by Data abstraction?
(b) Di\ufb00erence between \u201cC structure\u201d and \u201cC++ structure\u201d.
(c) Di\ufb00rence between a \u201cassignment operator\u201d and a \u201ccopy constructor\u201d.

(d) What is the di\ufb00erence between ?overloading? and \u201coverridding\u201d? [4+4+4+4]
2. (a) Explain the need for \u201cVirtual Destructor\u201d.
(b) Can we have \u201cVirtual Constructors\u201d?
[8+8]
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\ufb02y the asymptotic notations used for \ufb01nding the complexity of
Algorithms.
(b) Write a C++ program to implement the sparse matrix.
[8+8]
5. De\ufb01ne the abstract class for dictionary? Write the methodsf 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\u03b8
(logn) time in the worst case.
(b) Derive the amortized complexity of a \ufb01nd, insert or delete operation performed
on a splay tree with n elements.
[8+8]
7. (a) Find a necessary and su\ufb03cient condition for the root of a depth \ufb01rst 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 (\u221a
n) +logn
where n> 4
8. (a) Show how Prim\u2019s 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]
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6
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
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6
1. (a) Explain about the dynamic memory allocation and de-allocation in C++.
(b) Explain about static inner classes with a program.
[8+8]
2. Explain the di\ufb00erence between virtual function and virtual inheritance.
[16]
3. (a) Why should we use iostream instead of the traditional cstdio?
(b) Why does a program go into an in\ufb01nite loop when someone enters an invalid
input character?
(c) How can we get std::cin to skip invalid input characters?
[5+6+5]
4. (a) What is meat by Pro\ufb01ling ? 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. 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\ufb01gured hash table in which neverUsed is true for every empty bucket.

[16]
6. De\ufb01ne a Binary Search Tree? Write the procedures to perform insertion, deletion
and searching in a binary search tree?
[16]
7. (a) Show that depth \ufb01rst search can be used to \ufb01nd 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\ufb00erentiate between Greedy method and Dynamic Programming
[8+8]
\u22c6 \u22c6 \u22c6 \u22c6 \u22c6
1 of 1

Activity (13)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Sri Nath Dwivedi liked this
Sunil Soni liked this
Sunil Soni liked this
syriluit liked this
syriluit liked this
ihatemweb liked this
prakash_vit liked this
arsh_ali5 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->