mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-11 03:10:58 +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:
@@ -19,7 +19,7 @@ fun levelOrder(root: TreeNode?): MutableList<Int> {
|
||||
val list = mutableListOf<Int>()
|
||||
while (queue.isNotEmpty()) {
|
||||
val node = queue.poll() // 队列出队
|
||||
list.add(node?.value!!) // 保存节点值
|
||||
list.add(node?._val!!) // 保存节点值
|
||||
if (node.left != null)
|
||||
queue.offer(node.left) // 左子节点入队
|
||||
if (node.right != null)
|
||||
|
||||
Reference in New Issue
Block a user