Fine tune the C codes.

This commit is contained in:
krahets
2023-04-17 22:15:06 +08:00
parent c4ea4e39f3
commit af0f92c18d
15 changed files with 29 additions and 103 deletions

View File

@@ -20,6 +20,7 @@ avlTree *newAVLTree() {
return tree;
}
/* 获取节点高度 */
int height(TreeNode *node) {
// 空节点高度为 -1 ,叶节点高度为 0
if (node != NULL) {
@@ -247,4 +248,6 @@ int main() {
/* 查询节点 */
TreeNode *node = search(tree, 7);
printf("\n查找到的节点对象节点值 = %d \n", node->val);
}
return 0;
}