5.4 二叉搜索树 #25
Replies: 0 comments 6 replies
-
二叉搜索树的定义中缺少了"相等"的情况 |
Beta Was this translation helpful? Give feedback.
-
测试用例中好像都不包含"相等"的情况,所以不考虑相等的情况,也能通过。 |
Beta Was this translation helpful? Give feedback.
-
4.2 二叉搜索树的创建代码实现 中第12行,编译器应该会报错:未定义val |
Beta Was this translation helpful? Give feedback.
-
删除节点 如果看不明白 可以参考这个人的逻辑,大体是一样的 |
Beta Was this translation helpful? Give feedback.
-
一般来说,二叉搜索树中没有值相等的节点。当然,如果增加值相等的节点这一要求的话,可以将左子树的小于改为小于等于或者将右子树的大于改为大于等于。 |
Beta Was this translation helpful? Give feedback.
-
已增加 TreeNode 类的定义,稍后更新文章~ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
5.4 二叉搜索树
二叉搜索树 # 1. 二叉搜索树简介 # 二叉搜索树(Binary Search Tree):也叫做二叉查找树、有序二叉树或者排序二叉树。是指一棵空树或者具有下列
https://algo.itcharge.cn/05_tree/05_04_binary_search_tree/
Beta Was this translation helpful? Give feedback.
All reactions