Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CS18301

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Q.

Code: 991278

B.E./B.TECH. Degree Examination, December 2020


Third Semester
CS18301 – DATA STRUCTURES
(Regulation 2018)
Time: Three hours Maximum : 80 Marks
Answer ALL questions
PART A - (8 X 2 = 16 marks)
1. Which of the following makes use of Queue datastucture?
a. Dijkstra’s Algorithm b. BFS c. Both a & b d. None of the above
2. What is the output at the end of pass2 when radix sort is applied on the following
words?
{NOW, TAP, HOW, TEA, BIG}
a. TEA,BIG,TAP,NOW,HOW c. TAP,TEA,BIG,NOW,HOW
b. BIG,TAP,TEA,HOW,NOW d. TAP,TEA,BIG,HOW,NOW
3. Find the preorder traversal of the Splay tree formed with the following key
values:12,14,13,25,16
a. 12,13,14,16,25 b. 16,14,13,12,25 c. 16,25,14,13,12 d. 25,16,14,13,12
4. For an undirected graph with ‘n’ vertices, the maximum number of edges is given by,
a. n(n-1) b. n(n-1)/2 c. n^2 d. 2n
5. Write a routine to insert the given element in proper position of the given sorted array.
6. Write a recursive routine to find the length of the given linked list.
7. Construct a binary search tree with the following key values { 12,56,2,5,8,10,48} and
perform the preorder traversal.
8. Write the pseudocode to perform the Depth First Search on the given graph.

PART B - (4 X16 = 64 marks)


09. (a) Choose the best sorting algorithm to find the surpasser count for each (16)
element in the given array. Surpasser count of any element in the array is
the number of elements to its right in the array which is greater than the
element.
Input: {4,6,3,9,7,10} Output : {4,3,3,1,1,0}
(OR)
(b) Illustrate the working of Quick sort algorithm on {6,34,9,3,15,8,12,16,29}. (16)
Also give suitable code to arrange the elements in increasing order using
the same.

1
Q. Code: 991278

10. (a) Let L1 and L2 be two linked lists that contain integers in sorted order. (16)
Implement a list L3 which should contain integers from L1 and L2 in sorted
order.
Implement a list L4 which forms the intersection of lists L1 and L2.
Input: L1: {12,15,16,18} , L2:{3,4,5,18,24}
Expected Output L3: {3,4,5,12,15,16,18,18,24} L4:{18}
(OR)
(b) Illustrate the operations on a Min-Heap-Insert on the Heap (16)
A={15,13,9,5,12,8,7,4,0,6,2,1}.

11. (a) Apply the operations of stack to convert the following infix expression to (16)
postfix expression with suitable code.
Infix Expression: a + b * c / d + e
(OR)
(b) Construct an AVL tree with the given set of key values: (16)
{12,45,32,6,8,34,2,8,65,77,99,100}. Perform necessary rotations.

12. (a) Illustrate the working of Dijkstra’s algorithm to find the shortest path from (16)
‘v1’ to all other vertices by considering the following graph :

(OR)
(b) Construct a minimum spanning tree using Prim’s and Kruskal’s algorithm (16)
for the following graph:

You might also like