- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBreadthFirstTraversal.java
More file actions
Latest commit
23 lines (18 loc) · 611 Bytes
/
Copy pathBreadthFirstTraversal.java
File metadata and controls
23 lines (18 loc) · 611 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
packagegraph;
importjava.util.ArrayDeque;
/* See restrictions in Graph.java. */
/** Implements a breadth-first traversal of a graph. Generally, the
* client will extend this class, overriding the visit method as desired
* (by default, it does nothing).
* @author Rafayel Mkrtchyan
*/
publicclassBreadthFirstTraversalextendsTraversal {
/** A depth-first Traversal of G, using FRINGE as the fringe. */
protectedBreadthFirstTraversal(GraphG) {
super(G, newArrayDeque<Integer>());
}
@Override
protectedbooleanvisit(intv) {
returnsuper.visit(v);
}
}