mca-2-sem-data-structures-rac202-2017 - Copy
mca-2-sem-data-structures-rac202-2017 - Copy
com
Printed Pages : 2 Roll No. RCA202
MCA
THEORY EXAMINATION (SEM–II) 2016-17
DATA STRUCTURES
SECTION – A
1 Attempt all parts of the question. 2×7=14
(a) Differentiate between primitive and non-primitive data structure with suitable example.
(b) Differentiate between single and multidimensional arrays.
(c) Draw the binary tree for the following expression:
a+b/c–d*e+f
(d) What is a recursion? In how many ways stacks can be implemented?
(e) Compare circular queue and deque.
(f) Write an algorithm to insert an element into an array.
(g)
www.aktuonline.com
SECTION –B
2 Attempt any five parts of the question. 7×5=35
(a) What are the different ways the graph is represented in computer memory? Explain
with suitable example.
(b) Consider inserting the keys 76, 26, 37, 59, 21, 65, 88 into a hash table of size m = 11
using quadratic probing with c1 = 1 and c2 = 3. Further consider that the primary hash
function is h(k ) k mod m .
(c) Write down the recursive version of binary search algorithm. Also find the time
complexity of the algorithm.
(d) Write C function or algorithm to implement BST for searching an element.
(e) Compare sequential searching and binary searching. Write an algorithm to find the
largest and second largest number of an array.
(f) Write Dijkastra algorithm for finding the shortest path from a source vertex.
(g) Write a program for insertion sorting. Analyze its running time.
(h) What do you understand by recursion? Discuss and write function for tower of Hanoi
problem.
SECTION - C
Attempt any two parts of the question. 10.5×2=21
3 Illustrate the execution of HEAP-SORT on the array.
A = <6,14,3,25,2,10,20,7,6>
www.aktuonline.com
www.aktuonline.com
4 Write an algorithm for the implementation of quick sort. Apply the algorithm to sort the
given list.
65, 70, 75, 80, 85, 60, 55, 40, 45
Also find its time and space complexity.
5 What is spanning tree. Find the minimum cost of the following tree and draw its spanning tree.
www.aktuonline.com
www.aktuonline.com