Logo

Programming-Idioms

History of Idiom 9 > diff from v46 to v47

Edit summary for version 47 by qwer:
[Kotlin] wrong submission

Version 46

2019-10-18, 14:17:03

Version 47

2019-10-18, 14:19:14

Idiom #9 Create a Binary Tree data structure

The structure must be recursive because left child and right child are binary trees too. A node has access to children nodes, but not to its parent.

Idiom #9 Create a Binary Tree data structure

The structure must be recursive because left child and right child are binary trees too. A node has access to children nodes, but not to its parent.

Code
val l = listOf(_a,_b,_c)
Code
data class Node(
    val key: Int,
    val left: Node? = null,
    val right: Node? = null
)
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/list-of.html