mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-27 03:56:29 +08:00
0e49f0053a
of c, cpp, java, js, ts, swift.
17 lines
376 B
Swift
17 lines
376 B
Swift
/**
|
|
* 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
|
|
}
|
|
}
|