powered by
Finds the elements in the component of root
root
dfs(adj, root)
A named adjacency list of a decomposable grah
The node from which the component should be found
All nodes connected to root
# NOT RUN { x <- list(a = c("b", "d"), b = c("a", "d"), c = c("b", "a"), d = c("e", "f"), e = c("d", "f"), f = c("d", "e")) dfs(x, "a") # }
Run the code above in your browser using DataLab