CSE207 Sec2 Final Summer-2021
CSE207 Sec2 Final Summer-2021
CSE207 Sec2 Final Summer-2021
b. Now consider five students don’t want play football anymore and you have decided to select top five
students from the waiting list constructed in question no 1(a) according to their priority number. Delete the
top five priority students from the Heap and perform necessary operations to rebuild the heap after deletion.
temp->data = data;
temp->left = temp->right = NULL;
return temp;
}
return root;
}
return 0;
}
Problem-4: [3 +5 + 2 + 5 + 5 = 20 Marks]
(a) Draw an undirected connected graph with eight vertices and at least 14 edges. The vertices should
be called u1, u2, u3, u4, u5, u6, u7 and u8. There must be at least 2 paths of length four from u4 to
u8 and a path of length three from u1 to u8.
(b) Show depth-first traversal of the graph constructed in part (a), where u8 is the starting node. Visit
adjacent nodes in a clockwise ordering from a particular node (12 o’clock position). Show each
step to find the traversal sequence using the appropriate data structure.
(c) Convert the graph of part (a) into a weighted graph by assigning weights to each of the edges of
the graph; ranging 5 - 15 (randomly pick any value). Do not assign the same weight to more than
2 edges.
(d) Construct the minimum spanning tree for the weighted graph constructed in part (c). Also compute
the weight. Show the steps you applied to construct the minimum spanning tree.
(e) Use Dijkstra's algorithm to calculate minimum cost path (Show detail steps), for the weighted graph
constructed in part (c), to travel from node u4 to all other nodes and show the corresponding routes.