CST201 Data Structures, December 2022
CST201 Data Structures, December 2022
RegNo.: Name:
I Compute the time complexity of linear search algorithm using frequency count (3)
rnethod
2 Explain space complexity (3)
Explain self-referential structure with an example. Give any one use of self- (3)
referential structure.
Write an algorithm /pseudocode to count the number of nodes in a singly (3)
linked list
Explain BST and its properties. Give an example (3)
r7
8 Express the adjacency matric and the adjacency list representation ofthe graph (3)
Page lof3
PART B
Answer any onefull qrestionfrom each module. Eoch question carries 14 marks
Module I
I I a Explain various asymptotic notations used in analysis of algorithm (9)
b Calculate the frequency count of the statement x = x+1; in the following code (5)
segment
x=x+1;.
12 a Explain System life cycle in detail (g)
b What do you mean by Time complexity of an algorithm? Derive the Big O (6)
notation for the function f(n) = n2+3n+2
Module 2
13 a Write the binary search algorithms and demonstrate it with an example. (S)
b Explain the data Structure Stack in detail. Display the status of a stack with (6)
maximum capacity 5.on the following operations (in order ) on it.
Pop( ), Push(5), push(4), Pop( ), Push(9)
14 a Write the algorithm to evaluate Postfix expression and show each steps in the (S)
evaluation ofthe expression: 2 3 + g - 5 r'
b What do you mean by circular queue? Write algorithms to insert and delete (6)
elements on circular queue.
Module 3
15 a What are the advantages of linked list over arrays? Write algorithms to (8)
: implemefrt Queue using linked list
b Given five memory partitions of 300Kb, 700Kb, 400Kb, 500Kb, g00Kb (in (6)
order), how would the first-fit,r$est-fit, and worst-fit algorithms place
processes of 4l2Kb,617 Kb, I 12 Kb, and 626Kb (in order)?
16 a Write polynomial addition algorithm using linked list and illustrate with an (10)
example
b Compare singly linked list and doubly linked list (4)
" Module 4
17 Write Breadth First Search algorithm and illustrate it on the below graph . (8)
Page 2of3
How to represent a binary tree using Arrays ? construct a binary tree from the
following elements arranged in an array A[l:15] as: (6)
I 2 3 4 5 6 7 8 9 l0 n t2 l3 t4 15
A B c D E F G H
18a what do you mean by a BST?. write an algorithm to remove an element from (10)
a Binary Search Tree. Demonstrate each case with an example
b Compare complete binary tree and full binary tree (4)
Module 5
19 a Write Merge Sort algorithm and demonstrate it to sort the list {12, 65,34, g, (10)
56, 43, I 0)-in ascending order.
Page 3of3