public class PQ5
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PQ5.Node |
Modifier and Type | Field and Description |
---|---|
static java.util.ArrayList<PQ5.Node> |
nodes |
Constructor and Description |
---|
PQ5() |
Modifier and Type | Method and Description |
---|---|
static java.util.ArrayList<PQ5.Node> |
buildGraph() |
static void |
depthFirst(PQ5.Node current)
depthFirst: depth first traversal printing letters
If Node is null, return
If Node is visited, return
Print the letter in the Node
Mark Node as visited
Recursively call the left, center, and right child (in that order)
|
static void |
main(java.lang.String[] args) |
public static java.util.ArrayList<PQ5.Node> nodes
public static void main(java.lang.String[] args)
public static java.util.ArrayList<PQ5.Node> buildGraph()
public static void depthFirst(PQ5.Node current)
current
- the current node in the Graph