mid2review - CMPS 101 Midterm 2 Review Problems Figure 1: 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPS 101 Midterm 2 Review Problems Figure 1: 1 2 3 4 5 6 7 8 9 10 11 12 Figure 2: 1 2 3 4 5 6 7 8 9 10 Figure 3: 1 2 3 4 5 6 Problems 1. Trace BFS on the following graphs. For each vertex, record its color, parent, and distance fields, and draw the resulting BFS tree. Process adjacency lists in (ascending) numerical order. a. The graph in figure 1, with 1 as the source. b. The directed graph in figure 2 with 1 as source. 2. Trace DFS on the following graphs. For each vertex, record its color, parent, discover, and finish fields, and draw the resulting DFS forest. Classify each edge as tree, back forward, or cross. Process adjacency lists in (ascending) numerical order. a. The graph in figure 1. Process vertices in the main loop of DFS in (ascending) numerical order. b. The graph in figure 2. Process vertices in the main loop of DFS in (ascending) numerical order. c. The transpose of the graph in figure 2. Process vertices in the main loop of DFS in order of descending finish times from part b. Determine the strongly connected components of the graph in
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

mid2review - CMPS 101 Midterm 2 Review Problems Figure 1: 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online