public class Test
extends java.lang.Object
Constructor and Description |
---|
Test() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Call the test methods you've written.
|
static void |
test_BFS_vs_DFS()
Test that DFS and BFS give expected results for a graph we know.
|
static void |
test_SortList()
Create some nodes in random order, store them,
display the list, sort the list, display
|
public static void main(java.lang.String[] args)
args
- UNUSEDpublic static void test_SortList()
public static void test_BFS_vs_DFS()
NODES A B C D E F G H I EDGES A B 1 A D 1 B C 1 C D 1 C E 1 C F 1 D G 1 D F 1 E F 1 E H 1 G H 1 H I 1
This tests traversals on undirected graph given in class on Thursday 4/14
DFS(a,i) should be: dfs = a[--1--> b, --1--> c, --1--> d, --1--> f, --1--> e, --1--> h, --1--> i] BFS(a,i) should be: bfs = a[--1--> d, --1--> g, --1--> h, --1--> i]
You can try other traversals on this graph or any that you configure in a similar way.