ds model
ds model
1. (a) Explain the following two comparison sort algorithms with an example and write their
time complexities?
i. Bubble sort
ii. Selection sort
[BL: Understand | CO 2| Marks:6]
(b) Write the name of the sorting technique which is used in playing cards game? Write a
procedure for sorting a given list of numbers using that technique?
14, 25, 36, 74, 85, 6, 53, 62, 41
[BL: Apply | CO 2| Marks:6]
MODULE-II
3. (a) Write an algorithm/program to implement following operations in the Singly Linked list?
(i) Insert the node at end
(ii) Delete the node whose value = Y.
[BL: Apply | CO 3| Marks:6]
(b) Write advantages and disadvantages of linked list, doubly linked list and circular linked
list with example. [BL: Understand | CO 2| Marks:6]
4. (a) What are the advantages of doubly linked list? Write a function to find maximum element
from doubly linked list [BL: Understand | CO 3| Marks:6]
(b) Write an algorithm to insert a node before a given node in a singly linked list. Is it
advantageous to use a doubly linked list for this operation? Explain.
[BL: Analyze | CO 6| Marks:6]
MODULE-IV
5. (a) Briefly explain advantages of binary search tree. Construct binary search tree for the
following elements
8, 3, 11, 5, 9, 12, 13, 4, 6, 20 [BL: Apply | CO 4| Marks:6]
(b) The in-order and preorder traversal of a binary tree are
dbeafcg
a b d e c f g respectively
Construct binary tree and find its post-order traversal
[BL: Apply | CO 4| Marks:6]
7. (a) Create a Binary Search Tree for the following data and do In-order, Preorder and Post-
order traversal of the tree.
50, 60, 25, 40, 30, 70, 35, 10, 55, 65, 5 [BL: Apply | CO 4| Marks:6]
(b) The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of
length 10 using open addressing with hash function h(k) = k mod 10 and linear probing.
What is the resultant hash table? [BL: Apply | CO 5| Marks:6]
8. (a) What do you mean by hashing? What are the various hash functions? Explain each one
in brief. [BL: Understand | CO 5| Marks:6]
(b) Define AVL tree. Construct AVL tree for following data
10,20,30,40,50,60,70,80
[BL: Apply | CO 3| Marks:6]
**END OF EXAMINATION**
Page 2
COURSE OBJECTIVES:
The course should enable the students to:
COURSE OUTCOMES:
After successful completion of the course, students should be able to:
Page 3
b Write the name of the sorting technique which is Apply CO 2 PO 1,
used in playing cards game? Write a procedure PO 10
for sorting a given list of numbers using that
technique?
14, 25, 36, 74, 85, 6, 53, 62, 41
a Evaluate the following postfix expression using Understand CO 3 PO 1,
2
stack: (i) 9 3 4 * 8 + 4 / - PO 2,
(ii) 5 6 2 + * 1 2 4 / - + PO 3,
PO 10
b Define a double ended queue (DEQUE). Explain Remember CO 2 PO 1,
input restricted and output restricted DEQUE. PO 2,
Write an algorithm of input restricted DEQUE? PO 3,
PO 10
a Write an algorithm/program to implement Apply CO 3 PO 1,
3
following operations in the Singly Linked list? PO 2,
(i) Insert the node at end PO 3,
(ii) Delete the node whose value = Y. PO 10
b Write advantages and disadvantages of linked Remember CO 2 PO 1,
list, doubly linked list and circular linked list PO 2,
with example. PO 3,
PO 10
a What are the advantages of doubly linked list? Understand CO 3 PO 1,
4
Write a function to find maximum element from PO 2,
doubly linked list PO 3,
PO 10
b Write an algorithm to insert a node before a Analyze CO 6 PO 1,
given node in a singly linked list. Is it PO 2,
advantageous to use a doubly linked list for this PO 3,
operation? Explain. PO 10
a Briefly explain advantages of binary search tree. Apply CO 4 PO 1,
5
Construct binary search tree for the following PO 10
elements
8,3,11,5,9,12,13,4,6,20
b The in-order and preorder traversal of a binary Apply CO 4 PO 1,
tree are d b e a f c g PO 2,
a b d e c f g respectively PO 3,
Construct binary tree and find its post-order PO 10
traversal.
a Create a B-tree of order 5 by inserting the Apply CO 6 PO 1,
6
following data values. PO 2,
D, H, K, Z, B, P, Q, E, A, S, W, T, C, L, N, Y, PO 3,
M PO 10
Page 4
b Define directed graph, spanning tree and Apply CO 6 PO 1,
minimum spanning tree. Find minimum PO 2,
spanning tree for the graph shown in Figure PO 3,
PO 10
1.
a Create a Binary Search Tree for the following Apply CO 4 PO 1,
7
data and do In-order, Preorder and Post-order PO 2,
traversal of the tree. PO 3,
50, 60, 25, 40, 30, 70, 35, 10, 55, 65, 5 PO 10
b The keys 12, 18, 13, 2, 3, 23, 5 and 15 are Apply CO 5 PO 1,
inserted into an initially empty hash table of PO 2,
length 10 using open addressing with hash PO 3,
function h(k) = k mod 10 and linear probing. PO 10
What is the resultant hash table?
a What do you mean by hashing? What are the Understand CO 5 PO 1,
8
various hash functions? Explain each one in PO 10
brief.
b Define AVL tree. Construct AVL tree for Apply CO 3 PO 1,
following data PO 2,
10,20,30,40,50,60,70,80 PO 3,
PO 10
Page 5
KNOWLEDGE COMPETENCY LEVELS OF MODEL QUESTION PAPER
10
9
6
5
Count
2
1 1
0 0
0
ly
e
r
nd
te
z
be
at
pp
ly
ua
ta
re
em
na
A
al
rs
C
Ev
A
em
e
nd
R
Page 6