docs(tree/avl_tree): add go code

This commit is contained in:
reanon
2023-01-09 01:12:19 +08:00
parent cb0071924e
commit 388509a842
2 changed files with 161 additions and 9 deletions

View File

@@ -16,8 +16,7 @@ func newAVLTree() *avlTree {
return &avlTree{root: nil}
}
/* 获取结点高度
*/
/* 获取结点高度 */
func height(node *TreeNode) int {
// 空结点高度为 -1 ,叶结点高度为 0
if node != nil {