BCS304 Assignment2
BCS304 Assignment2
2 Design an algorithm to traverse a graph using Depth First Search (DFS). Apply CO5 L3 P01-
DFS for the graph given below. PO5,PSO1
3 Define Binary Search tree. Construct a binary search tree (BST) for the following CO4 L3 P01-
elements: 100, 85, 45, 55, 120, 20, 70, 90, 115, 65, 130, 145. Traverse using in-
order, pre-order, and post-order traversal techniques. Write recursive C functions PO5,PSO1
for the same.
4. Define the Disjoint set. Consider the tree created by the weighted union function CO4 L3 P01-
on the sequence of unions: union(0,1), union(2,3), union(4,5), union(6,7),
union(0,2), union(4,6), and union(0,4). Process the simple find and collapsing PO5,PSO1
find on eight finds and compare which find is efficient.
5. Define the leftist tree. Give its declaration in C. Check whether the given binary CO5 L3 P01-
tree is a leftist tree or not. Explain your answer.
PO5,PSO1
Page 1 of 3
6. Define min Leftist tree. Meld the given min leftist trees . CO5 L3 P01-
PO5,PSO1
7 What is chained hashing? Discuss its pros and cons. Construct the hash table to CO5 L3 P01-
insert the keys: 7, 24, 18, 52, 36, 54, 11, 23 in a chained hash table of 9 memory
locations. Use h(k) = k mod m. PO5,PSO1
8. Define Forest. Transform the given forest into a Binary tree and traverse using CO4 L2 P01-
inorder, preorder and postorder traversal.
PO5,PSO1
9 Define selection tree. Construct min winner tree for the runs of a game given CO4 L2 P01-
below. Each run consists of values of players. Find the first 5 winners.
PO5,PSO1
Page 2 of 3
10 Explain the Following: CO5 L2 P01-
i. AVL Tree
ii. Red black Tree PO5,PSO1
iii. Splay Tree
Course Faculty
Dr. A.Rosline Mary
Page 3 of 3