SECTION II
(Some answers require a double-click with the mouse to view.)
1. Give the definition of an algorithm?

2. What are the three basic sorting algorithms?

3. What is the degree of vertex b in a graph?

4. What are the three common ways to represent a graph?
SECTION III. ALGORITHMS AND APPLICATIONS

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.

INITIAL {5, 3, 7, 2, 8, 6}

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.

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. 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. 4. List the vertices visited in the graph as shown in Figure 3 in DEPTH-FIRST SEARCH order.  