mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
refactor: use Package.swift to define executable task
This commit is contained in:
17
codes/swift/utils/TreeNode.swift
Normal file
17
codes/swift/utils/TreeNode.swift
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* File: TreeNode.swift
|
||||
* Created Time: 2023-01-02
|
||||
* Author: nuomi1 (nuomi1@qq.com)
|
||||
*/
|
||||
|
||||
public class TreeNode {
|
||||
public var val: Int // 结点值
|
||||
public var height: Int // 结点高度
|
||||
public var left: TreeNode? // 左子结点引用
|
||||
public var right: TreeNode? // 右子结点引用
|
||||
|
||||
public init(x: Int) {
|
||||
val = x
|
||||
height = 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user