mirror of
https://github.com/AdrianKuta/Tree-Data-Structure.git
synced 2025-12-31 20:24:55 +01:00
21: Added path function to TreeNode (#22)
Path refers to the sequence of nodes along the edges of a tree.
This commit is contained in:
14
src/jvmMain/kotlin/Example.ws.kts
Normal file
14
src/jvmMain/kotlin/Example.ws.kts
Normal file
@@ -0,0 +1,14 @@
|
||||
import com.github.adriankuta.datastructure.tree.tree
|
||||
|
||||
val root =
|
||||
tree("World") {
|
||||
child("North America") {
|
||||
child("USA")
|
||||
}
|
||||
child("Europe") {
|
||||
child("Poland")
|
||||
child("Germany")
|
||||
}
|
||||
}
|
||||
|
||||
print(root.prettyString())
|
||||
Reference in New Issue
Block a user