Step 1: A = B = C = D = NOT REACHED.

Step 2: READY = {A}. A = REACHED.

Step 3: Process A. READY = {B,C}. B = C = REACHED.

Step 3: Process C. READY = {B,D}. D = REACHED.

Step 3: Process B. READY = {D}.

Step 3: Process D. READY = {}.

The algorithm will only traverse a connected graph. To traverse an arbitrary graph: repeat until all nodes have been REACHED.

Breadth-First Traversal: READY is a queue. Nodes are processed in the order they are REACHED, i.e. according to their distance from the initial node.

Depth-First Traversal: READY is a stack. Most recently REACHED nodes are processed before earlier nodes.