Skip to content

Instantly share code, notes, and snippets.

@cbeust
Created February 7, 2017 20:17
Show Gist options
  • Save cbeust/cdfd823b66f50ce9fe6f41ad4f191f60 to your computer and use it in GitHub Desktop.
Save cbeust/cdfd823b66f50ce9fe6f41ad4f191f60 to your computer and use it in GitHub Desktop.
fun <T> displayGraph(roots: List<INode<T>>, indent: String = “”) {
roots.forEach {
println(indent + it.value)
displayGraph(it.children, indent + “ “)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment