mirror of
				https://github.com/AdrianKuta/Tree-Data-Structure.git
				synced 2025-10-31 00:43:40 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			586 B
		
	
	
	
		
			Kotlin
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			586 B
		
	
	
	
		
			Kotlin
		
	
	
	
	
	
| package com.github.adriankuta.datastructure.tree
 | |
| 
 | |
| import kotlin.jvm.JvmSynthetic
 | |
| 
 | |
| interface ChildDeclarationInterface<T> {
 | |
| 
 | |
|     /**
 | |
|      * This method is used to easily create child in node.
 | |
|      * ```
 | |
|      * val root = tree("World") {
 | |
|      *     child("North America") {
 | |
|      *         child("USA")
 | |
|      *     }
 | |
|      *     child("Europe") {
 | |
|      *         child("Poland")
 | |
|      *         child("Germany")
 | |
|      *     }
 | |
|      * }
 | |
|      * ```
 | |
|      * @return New created TreeNode.
 | |
|      */
 | |
|     @JvmSynthetic
 | |
|     fun child(value: T, childDeclaration: ChildDeclaration<T>? = null): TreeNode<T>
 | |
| } |