Refine kotlin code (#1241)

* style(kotlin): Improve kotlin codes readability.

* remove redundant quotes.

* style(kotlin): improve codes readability.

* style(kotlin): refine kotlin codes.

* Create kotlin.yml

* Create kotlin.yml

* Delete .github/workflows/kotlin

* Delete .github/workflows/main.yml

* Create kotlin.yml

* Update kotlin.yml

* Delete .github/workflows/kotlin.yml

* Create hello_world_workflow.main.kts

* Delete .github/workflows/hello_world_workflow.main.kts

* remove empty line
This commit is contained in:
curtishd
2024-04-09 16:26:58 +08:00
committed by GitHub
parent 41dd677338
commit 896d9a64f6
22 changed files with 158 additions and 112 deletions
+3 -2
View File
@@ -7,6 +7,7 @@
package utils
/* 二叉树节点类 */
/* 构造方法 */
class TreeNode(
var value: Int // 节点值
) {
@@ -59,8 +60,8 @@ class TreeNode(
}
/* 将二叉树序列化为列表 */
fun treeToList(root: TreeNode?): List<Int?> {
val res = ArrayList<Int?>()
fun treeToList(root: TreeNode?): MutableList<Int?> {
val res = mutableListOf<Int?>()
treeToListDFS(root, 0, res)
return res
}