Uploaded by donga chedi

CSE205

advertisement
Registration No.:__________________
PNR No:: 114151CSE15657
COURSE CODE : CSE205
COURSE NAME : DATA STRUCTURES AND ALGORITHMS
Time Allowed: 03:00 hrs
Max.Marks: 100
1. This paper contains 6 questions divided in two parts.
2. All questions are compulsory.
3. The marks assigned to each questions are shown at the end of each question in square brackets.
4. Attempt either (a) OR (b) from each question of Part B.
5. Answer all questions in serial order.
6. Do not write anything on the question paper except your registration number at the designated space.
PART A
Q1(a) Differentiate between Theta and Omega Notation?
(b) Explain the concept of record?
(c) What do you mean by Recursion?
(d) Differentiate between LR and RL rotations with example.
(e) How does a priority queue works?
(f) What are various operations supported in stack?
(g) Mention any Two properties of B-Tree?
(h) What are the different cases for deletion in Binary Search Tree?
(i) What do you mean by Time space trade-off among algorithms?
(j) Define the overflow and underflow conditions of a linked list.
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
[2.5 Marks]
PART B
Q2(a) How is complexity effected with the use of binary search algorithm while searching in a list? Under
what circumstances you will prefer to use linear search? Write algorithm for both searching techniques.
[15 Marks]
OR
(b) Write the algorithms for insertion and deletion from a linear array. Also explain them with examples.
[15 Marks]
Q3(a) Write an algorithm to delete all the nodes containing zeros from a single linked list.
[15 Marks]
OR
(b) Write an algorithm to split a linked list in two parts one containing nodes with even number as info and
another containing nodes with odd numbers as info.
[15 Marks]
Q4(a) i) What is Min heap? Write an algorithm to delete the root node from a heap.
[7]
ii) Apply Heapsort to following given Elements in an array A, sort these elements in Descending Order.
44,30,50, 22,60,55,77,55
[8]
[15 Marks]
OR
(b) i) The inorder and postrder traversals of a binary tree are 4 5 6 3 1 8 7 9 11 10 12 and 4 6 5 3 8 11 12
10 9 7 1 respectively. Create a tree and find Postorder for the same.
[10]
ii) Write an algorithm to perform the Preorder traversal of Binary Tree T.
[5]
[15 Marks]
Q5(a) Write the shortest-path algorithm. Also take an example weighted graph and find the shortest path
for that graph.
[15 Marks]
OR
(b) Discuss different graph traversal methods with example.
[15 Marks]
Q6(a) Write algorithm to perform merge sort
[15 Marks]
OR
(b) Consider a company with 68 employees assigns a unique 4-digit employee number to each employee.
Memory addresses are 00,01,02,03.......97,98,99. Find 2 digit hash address for employee 8613, 4671,
5202, 4409, 1814 using
(i) division method with m = 97
(ii) midsquare method
(iii) folding method with reversing
[15 Marks]
-- End of Question Paper --
Page 1 of 1
Download