Skip to content

Commit 1c0a175

Browse files
author
Justin Wetherell
committed
Renamed the BFT static method
1 parent ee534ee commit 1c0a175

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/com/jwetherell/algorithms/graph/BreadthFirstTraversal.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class BreadthFirstTraversal {
1616

1717
@SuppressWarnings("unchecked")
18-
public static final <T extends Comparable<T>> Graph.Vertex<T>[] depthFirstTraversal(Graph<T> graph, Graph.Vertex<T> source) {
18+
public static final <T extends Comparable<T>> Graph.Vertex<T>[] breadthFirstTraversal(Graph<T> graph, Graph.Vertex<T> source) {
1919
// use for look-up via index
2020
final ArrayList<Vertex<T>> vertices = new ArrayList<Vertex<T>>();
2121
vertices.addAll(graph.getVertices());

test/com/jwetherell/algorithms/graph/test/BreadthFirstTraversalTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class BreadthFirstTraversalTest {
3838

3939
@Test
4040
public void test1() {
41-
final Graph.Vertex<Integer>[] result = BreadthFirstTraversal.depthFirstTraversal(graph, v2);
41+
final Graph.Vertex<Integer>[] result = BreadthFirstTraversal.breadthFirstTraversal(graph, v2);
4242
Assert.assertTrue(result[0].getValue()==2);
4343
Assert.assertTrue(result[1].getValue()==0);
4444
Assert.assertTrue(result[2].getValue()==3);
@@ -47,7 +47,7 @@ public void test1() {
4747

4848
@Test
4949
public void test2() {
50-
final Graph.Vertex<Integer>[] result = BreadthFirstTraversal.depthFirstTraversal(graph, v0);
50+
final Graph.Vertex<Integer>[] result = BreadthFirstTraversal.breadthFirstTraversal(graph, v0);
5151
Assert.assertTrue(result[0].getValue()==0);
5252
Assert.assertTrue(result[1].getValue()==1);
5353
Assert.assertTrue(result[2].getValue()==2);

0 commit comments

Comments
 (0)