package com.github.adriankuta.datastructure.tree import com.github.adriankuta.datastructure.tree.iterators.TreeNodeIterators import kotlin.jvm.JvmSynthetic public typealias ChildDeclaration = ChildDeclarationInterface.() -> Unit /** * This method can be used to initialize new tree. * ``` * val root = tree("World") { ... } * ``` * @param root Root element of new tree. * @see [ChildDeclarationInterface.child] */ @JvmSynthetic public inline fun tree( root: T, defaultIterator: TreeNodeIterators = TreeNodeIterators.PreOrder, childDeclaration: ChildDeclaration ): TreeNode { val treeNode = TreeNode(root, defaultIterator) treeNode.childDeclaration() return treeNode }