Semester : SEMESTER 3
Subject : Data Structures
Year : 2019
Term : DECEMBER
Branch : COMPUTER SCIENCE AND ENGINEERING
Scheme : 2015 Full Time
Course Code : CS 205
Page:2
14
15
16
17
18
19
b)
a)
b)
a)
b)
a)
b)
a)
b)
a)
b)
a)
b)
a)
b)
C192039 Pages:2
Create a Binary Search tree (BST) using the following data entered sequentially.
10, 5, 14, 7, 12, 18, 15, 13
i) Perform in order traversal of the created BST.
ii) Delete 7, 18 and 10 from the created BST.
Write an algorithm/pseudo code for postfix evaluation using stack.
Write an algorithm/pseudo code to search for a given element in a binary search
tree.
PART E
Answer any four full questions, each carries 10 marks.
How a graph is represented using adjacency matrix? Give example.
Explain BFS with the help of an algorithm/pseudo code. Perform BFS on the
given graph, starting from node 5.
INT โุงโ
Design an iterative binary search algorithm.
An array contains the elements shown below. Using the Binary search algorithm,
trace the steps followed to find 88. After each iteration, show the contents of
variables used. What is the number of comparisons required?
13, 17, 18, 26,44, 56, 88, 97, 100
Write an algorithm/pseudo code for performing linear search in an array of n
elements and find the time complexity for the best, worst and average case.
Write down the algorithm/pseudo code for insertion sort.
Write an algorithm/ pseudo code for performing merge sort on an array of n
elements.
Where is a hash table data structure used? Explain any two commonly used hash
functions with examples.
Define a max heap. Construct a max heap with the following set of numbers
entered sequentially.
10, 5, 14, 7, 12, 18, 15, 13
Let the size of a hash table be 7. The index of the hash table varies from 0 to 6.
Consider the keys 89, 18, 49, 58, 25 in the order. Show how the keys are stored
in the hash table (use linear probing).
Write an algorithm/ pseudo code for performing Quick sort on an array of n
elements.
Let the size of the hash table be 10. The index of the hash table varies from 0 to
9. Consider the keys 43, 24, 57, 12, 10, 64, 19, 82, 36, 39 in the order. Show how
the keys are occupied. Use chaining method.
HK
Page 2 of 2
(6)
(5)
(4)
(4)
(6)
(5)
(5)
(5)
(5)
(5)
(5)
(5)
(5)
(5)
(5)