示例#1
0
文件: DFS.java 项目: kuity/kotlin
 public static <N, R> R dfsFromNode(
     @NotNull N node,
     @NotNull Neighbors<N> neighbors,
     @NotNull Visited<N> visited,
     @NotNull NodeHandler<N, R> handler) {
   doDfs(node, neighbors, visited, handler);
   return handler.result();
 }
示例#2
0
文件: DFS.java 项目: kuity/kotlin
 public static <N, R> R dfs(
     @NotNull Collection<N> nodes,
     @NotNull Neighbors<N> neighbors,
     @NotNull Visited<N> visited,
     @NotNull NodeHandler<N, R> handler) {
   for (N node : nodes) {
     doDfs(node, neighbors, visited, handler);
   }
   return handler.result();
 }