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

GOVT.

ENGINEERING COLLEGE THRISSUR


EIGHTH SEMESTER B.TECH DEGREE EXAMINATION, JUNE 2021

Course Code: CS 482

Course Name: Data Structures

Max. Marks: 70 Duration: 2.15 Hours

Part A

Answer all questions from Part A, each carries 3 marks.

1 Explain the significance of documentation in programs


Any two significance – clear code, readable, communication
2 What is space complexity of a program?
Explanation of static, stack and heap memory
3 What is an Abstract Data Type? Explain with an example.
Abstract Data Type explanation – 2 marks, example – 1 mark.
4 Compare stack implementation using array and linked list.
Any two points – 1.5 marks each.
5 What is a Binary Search Tree?
Just definition is only required
6 Explain height of a Binary Tree with an example.
Height definition 2 marks, example - 1 mark.
7 What is overflow in hashing?
Just definition of overflow in hashing
8 Explain how path information is stored in Dijkstra’s Algorithm.
Explain predecessor array – 3 marks.
9 Explain the base case of recursion in recursive Merge sort.
Merging starts when lists are of size one.- 3 marks
10 Explain why hash table sizes are usually of prime numbers.
Explanation 3 marks.

Part B

Answer any two full questions from Part B, each carries 6 marks.

11 (a) Explain the following( Explanation only required)

(i) Stepwise refinement 1marks

(ii) Structured Programming 2 marks

(b) Derive the Big Oh complexity for finding the sum of given 'n' numbers.
Derive the O(n) - 3 marks

11 (a) Explain frequency count in algo


algorithm analysis with an example
Explanation of frequency count 1 mark , example 1 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:

(a)Insertion after a given position (3 marks)

(b)Deleting all occurrences of an element (3 marks)

Algorithm/
lgorithm/ program for performing doubly linked list operation – 2 marks example 1
mark each for both sub parts

Part C

Answer anyy two full questions from Part C


C, each carries 6 marks.

14 (a) Explain what is a Max--Heap with an example. (2 marks)

Explanation for Max-Heap


Heap – 1 mark example - 1 mark

(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)

Explanation for Binary Tree using array – 2 marks , example-1 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.

Discussion of Queue and its implementation for this problem. 3 marks

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)

Each hashing function 1 mark each, example 1 mark each

(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)

Each difference carries 1.5 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

19 Give the algorithm/ program for Quick Sort. (4 marks)

Algorithm/ program for Quick Sort – 5

(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

You might also like