Está en la página 1de 4

www.jntuworld.

com

Set No. 1

Code No: 07A3EC20

II B.Tech I Semester Regular Examinations, November 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 should be placed inside a try block? Give the syntax.
(b) Write a program to implement the use of try block.

[8+8]

D
L

2. (a) Distinguish between early binding and late binding.


(b) Write a program to show how we achieve late binding.

R
O

3. (a) Calculate the time complexity of Bubble sort.

(b) Distinguish between Big O and Omega() notations.


4. (a) What is a Dictionary?
(b) Give the ADT for dictionary.

[8+8]

[8+8]

W
U

(c) What are the operations performed on dictionary? Explain them in detail.
[3+5+8]

T
N

5. What is priority queue? What are the applications of priority queue? How do you
implement a priority queue using Heap?
[16]
6. (a) How do you represent an AVL tree.

(b) What is the height of an AVL tree.


(c) Write an algorithm for searching an AVL tree.

[4+4+8]

7. (a) When do you use recursive approach as part of Divide and Conquer. Explain
it with example.
(b) When do you stop splitting a problem into sub problems. Explain.

[10+6]

8. Prove that kruskals algorithm generates a minimum cost spanning tree for every
connected undirected graph.
[16]

1 of 1

www.jntuworld.com

www.jntuworld.com

Set No. 2

Code No: 07A3EC20

II B.Tech I Semester Regular Examinations, November 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) Distinguish between errors and exceptions.


(b) Explain the mechanism provided in C++ for handling synchronous exceptions.
[8+8]

D
L

2. (a) What do you mean by overloading of a function? When de we use it?

(b) Write a program to implement function overloading to perform the operations


addition, substraction and multiplication both for integer and float data types.
[6+10]

R
O

3. (a) Write the insertion routine for linked list and explain.
(b) Write the deletion routine for linked list and explain.

W
U

[8+8]

4. (a) What is hashing? Why de we need hashing?

(b) Explain the importance of hashing with an example.

[8+8]

5. Explain in detail how Heap sort algorithm works with the help of an example. [16]

T
N

6. Insert the following in to AVL tree in the sequence: march, may , nov, august,
april, january, december, july, february, june, october, september.
[16]

7. (a) Consider the recurrence relation


T(n) = T(1)
if n=1
aT(n/b) = f(n)
if n >1
where a and b are constants. Assume n = bk
(b) Solve the recurrence relation for the following choices of a,b, and f(n):
i. a = 5, b=2 and f(n) = cn
ii. a= 5, b=4, and f(n) = cn2 .
(c) Solve the recurrence relation T(n) = 1 if n<=4
= T(sqrt(n)) + c if n>4
using substitution method.

[10+6]

8. (a) How do you measure the performance of an algorithm for constructing Optimal
Binary search tree.
(b) Write an algorithm to construct Optimal Binary search tree given the
root r(i,j), 0 <= j <= n.
[6+10]

1 of 1

www.jntuworld.com

www.jntuworld.com

Set No. 3

Code No: 07A3EC20

II B.Tech I Semester Regular Examinations, November 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 are the advantages of function prototypes in C++?


(b) What is the main advantage of passing arguments by reference? Explain with
an example.
[8+8]

D
L

2. (a) What does inheritance mean in C++? What are the benefits of inheritance?
(b) What are the different forms of inheritance? Give an example for each. [8+8]

R
O

3. (a) Discuss the components for the space needed by a program.

(b) Explain about the additional factors that may influence the space complexity
of a program.
[8+8]

W
U

4. (a) What is Open Addressing hashing?


(b) Explain Linear Probing.

(c) What are the disadvantages of Linear Probing?

T
N

[3+8+5]

5. What is the significance of priorities? How do you arrange elements in a priority


queue? How do you implement a priority queue.
[16]

6. Compare different search tress.

[16]

7. (a) How many comparisons are made by Binary search for a successful search and
for an unsuccessful search. Explain.
(b) Consider the list of elements: -15, -6, 0, 7, 9, 23, 54, 82, 101, 112, 125, 131,
142, 151. Trace the Binary search algorithm ser4aching for elements 151, -14,
9 respectively.
[8+8]
8. Dynamic programming often drastically reduces the amount of enumeration by
avoiding the enumeration of some decision sequences that can not possibly be optimal. Explain.
[16]

1 of 1

www.jntuworld.com

www.jntuworld.com

Set No. 4

Code No: 07A3EC20

II B.Tech I Semester Regular Examinations, November 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 an exception specification? When it is used? Explain.


(b) When should a program throw an exception? Explain with an example. [8+8]

D
L

2. (a) What is an abstract class?


(b) Why do we need abstract class?
(c) What are the rules for creating virtual base class?

R
O

(d) Write a program that shows the implementation of virtual base class. [3+3+3+7]
3. (a) Discuss the number or multiplications done by function called Multiplication
which multiplies an M N and an N P matrix.

W
U

(b) Compare the worst case number of elements moves made by functions in
Selection sort and Insertion sort. Compare the relative performance. [8+8]
4. (a) What are the problems associated with Quadratic Probing?

T
N

(b) How do you solve the problems of Quadratic Probing?

[8+8]

5. (a) Write the status of the list (12, 2, 16, 30, 8, 28, 4, 10, 20, 6, and 8) at the end
of each phase of Heap sort.

(b) Analyze the Heap sort.

[10+6]

6. Write algorithm for insertion in to B-tree. Explain it with examples.

[16]

7. (a) Run the Merge Sort algorithm on an array of elements:


(310,285,179,652,351,423,861,254,450,520).
(b) Compute the order of complexity of Merge Sort.

[8+8]

8. In Dynamic programming the optimal sequence of decisions is obtained by making


explicitly appeal to the principle of optimality. Explain.
[16]

1 of 1

www.jntuworld.com

También podría gustarte