mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-26 18:17:13 +00:00
feat(Kotlin): Replace value with _val (#1254)
* ci(kotlin): Add workflow file. * Update kotlin.yml * style(kotlin): value -> _val --------- Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
@@ -9,7 +9,7 @@ package utils
|
||||
/* 二叉树节点类 */
|
||||
/* 构造方法 */
|
||||
class TreeNode(
|
||||
var value: Int // 节点值
|
||||
var _val: Int // 节点值
|
||||
) {
|
||||
var height: Int = 0 // 节点高度
|
||||
var left: TreeNode? = null // 左子节点引用
|
||||
@@ -54,7 +54,7 @@ class TreeNode(
|
||||
while (i >= res.size) {
|
||||
res.add(null)
|
||||
}
|
||||
res[i] = root.value
|
||||
res[i] = root._val
|
||||
treeToListDFS(root.left, 2 * i + 1, res)
|
||||
treeToListDFS(root.right, 2 * i + 2, res)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user