DSA Model QP
DSA Model QP
DSA Model QP
Model Sub/
Test CD3291 / Data Structures and Algorithms
Exam Code:
PART – A (10X2=20)
C Leve
Q.no Questions
O l
1. Write a member function to find the greater of two numbers
1 1
using 'this' pointer. Write the various asymptotic notations.
6. What are the running times of Quick Sort and Merge Sort for
3 1
presorted input? Define internal and external sorting.
4 1 8.
Give the ways in which a graph can be represented with an
4 1 9.
example. What is meant by strongly connected in a graph?
PART – B
(5X13=65)
(i) Describe a recursive function for converting a string of digits
1 12.b
3 13.a (i) Write a routine for Insertion Sort. Sort the following sequence
1
using Insertion Sort 3,10,4,2,8,6,5,1 (7)
2 (ii) Illustrate the execution of the in-place heap-sort algorithm on
the following input sequence: (2,5,16,4,10,23,39,18,26,15).
(i) State the complexity of binary search? Distinguish between
linear search and binary search. State and explain the algorithms
3
1 for both the search with example.(7)
(ii) What are the advantage of separate chaining and Linear
Probing? Given input {4371,1323,6173,4199,9679, 1989} and a
13.b
hash function h(x)= x(mod10),show the resulting.(6)
14.b (ii) Draw the result of inserting, into an initially empty order-7 B-
tree, entries with keys
1
(4,40,23,50,11,34,62,78,66,22,90,59,25,72,64,77,39,12),
in this order. (6)
15.a
4
15.b