1. Array A has the following initial content: {5,3,7,2,8,6}
You have to sort the elements into ASCENDING ORDER using the SELECTION SORT algorithm.
The sorting takes five phases. Show the content of the array at the end of each phase.
2. Use the binary search tree shown in the following figure to answer A and B:
A. List the nodes in this binary tree using the PREORDER traversal algorithm.
ANSWER TO 2. A
B. Node 30 is deleted from the tree, and node 75 is inserted into the tree. Redraw the binary search tree to show these changes.
ANSWER TO 2. B
3. Create the adjacent matrix of the graph shown in Figure 2 using 0s and 1s as its
elements. An edge between two vertices is indicated by a 1; the absence of an edge is a 0.
ANSWER TO 3
4. List the vertices visited in the graph as shown in Figure 3 in DEPTH-FIRST SEARCH order.
5. Figure is a 2-3-4 tree. Redraw the tree after inserting keys 25 and 75 into the tree.
(A SPLIT OF NODE IS NECESSARY DURING THE INSERTION.)
ANSWER TO 5