Professional Documents
Culture Documents
CS482 Data Structures QP Final-Scheme - After Scrutiny
CS482 Data Structures QP Final-Scheme - After Scrutiny
Part A
Part B
Answer any two full questions from Part B, each carries 6 marks.
(b) Derive the Big Oh complexity for finding the sum of given 'n' numbers.
Derive the O(n) - 3 marks
(b) Give the algorithm/ program for displaying the elements in reverse order without
changing the list.. Input is a singly linked list. IIllustrate the working with a suitable
example. (4 marks)
Algorithm/ program for printing list in reverse– 2.5 marks example – 1.5 marks.
marks
13 Give the algorithm/ program for performing the following operations on a doubly linked
list and illustrate the working with a suitable example:
Algorithm/
lgorithm/ program for performing doubly linked list operation – 2 marks example 1
mark each for both sub parts
Part C
(b) Perform DFS traversal on the given graph and illustrate the working step by step.
step
(4 marks)
DFS traversal showing each step– 4 marks.
15 (a) Explain implementation of Binary Tree using array with an example. (3 marks)
(b) In an online booking system for movies, customers are allowed to book on a first
come first serve basis. Which data structure is appropriate for the implementation of
this system? Justify your answer.
16 (a)Give the algorithm/ program for performing Push on Stack implemented using linked
list and illustrate the working with a suitable example. (3marks)
Algorithm/ program for performing Push on Stack implemented using linked list 2
marks, example 1 mark
(b) Explain how two stacks can be implemented on a one dimensional array of size 20
with suitable illustration for the same. The total number of elements in both the stacks
together never exceeds 20 elements.
Explain how two stacks can be implemented on a one dimensional array 2 marks,
illustration 1 mark
Part D
Answer any two full questions from Part D, each carries 8 marks.
17 (a) Explain any two hashing function with suitable example (4 marks)
(b) Give the algorithm/ program that reports how many elements are greater than a
given value in an array of integers. (4 marks)
Algorithm/ program that report how many elements are greater than a given value in an
array of integers. - 4 marks
18 (a) State any two differences between searching and hashing. (3 marks)
(b) Using Prim’s Algorithm find MST by illustrating each step in the following graph.
(5 marks)
Illustration of Prim's algorit
algorithm for finding MST – 5 marks
(b) Illustrate the working of Quick sort on the following list of numbers: 21,13,2,5,7,42,24,8
(4 marks)
Illustration – 4 marks