Last active
February 7, 2017 20:12
-
-
Save cbeust/96675447b3799a8e909bfd35090b131b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node(val value: String, | |
val children: List<Node> = emptyList()) | |
fun displayGraph(roots: List<Node>, 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