Remove unused functions.

This commit is contained in:
krahets 2023-04-14 05:52:59 +08:00
parent f7ae9c8a02
commit b3640c53d1
4 changed files with 0 additions and 63 deletions

View file

@ -137,18 +137,6 @@ void insert(avlTree *tree, int val) {
tree->root = insertHelper(tree->root, val);
}
/* 获取中序遍历中的下一个节点(仅适用于 root 有左子节点的情况) */
TreeNode *getInOrderNext(TreeNode *node) {
if (node == NULL) {
return node;
}
// 循环访问左子节点,直到叶节点时为最小节点,跳出
while (node->left != NULL) {
node = node->left;
}
return node;
}
/* 递归删除节点(辅助方法) */
TreeNode *removeHelper(TreeNode *node, int val) {
TreeNode *child, *grandChild;

View file

@ -127,17 +127,6 @@ class BinarySearchTree {
cur.val = tmp.val;
}
}
/* 获取中序遍历中的下一个节点(仅适用于 root 有左子节点的情况) */
public TreeNode getInOrderNext(TreeNode root) {
if (root == null)
return root;
// 循环访问左子节点直到叶节点时为最小节点跳出
while (root.left != null) {
root = root.left;
}
return root;
}
}
public class binary_search_tree {

View file

@ -646,8 +646,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{removeHelper}
[class]{AVLTree}-[func]{getInOrderNext}
```
=== "C++"
@ -656,8 +654,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{removeHelper}
[class]{AVLTree}-[func]{getInOrderNext}
```
=== "Python"
@ -666,8 +662,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{__remove_helper}
[class]{AVLTree}-[func]{__get_inorder_next}
```
=== "Go"
@ -676,8 +670,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{aVLTree}-[func]{remove}
[class]{aVLTree}-[func]{removeHelper}
[class]{aVLTree}-[func]{getInOrderNext}
```
=== "JavaScript"
@ -686,8 +678,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{#removeHelper}
[class]{AVLTree}-[func]{#getInOrderNext}
```
=== "TypeScript"
@ -696,8 +686,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{removeHelper}
[class]{AVLTree}-[func]{getInOrderNext}
```
=== "C"
@ -706,8 +694,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{aVLTree}-[func]{remove}
[class]{aVLTree}-[func]{removeHelper}
[class]{aVLTree}-[func]{getInOrderNext}
```
=== "C#"
@ -716,8 +702,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{removeHelper}
[class]{AVLTree}-[func]{getInOrderNext}
```
=== "Swift"
@ -726,8 +710,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{removeHelper}
[class]{AVLTree}-[func]{getInOrderNext}
```
=== "Zig"
@ -736,8 +718,6 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{remove}
[class]{AVLTree}-[func]{removeHelper}
[class]{AVLTree}-[func]{getInOrderNext}
```
### 查找节点

View file

@ -202,80 +202,60 @@
```java title="binary_search_tree.java"
[class]{BinarySearchTree}-[func]{remove}
[class]{BinarySearchTree}-[func]{getInOrderNext}
```
=== "C++"
```cpp title="binary_search_tree.cpp"
[class]{BinarySearchTree}-[func]{remove}
[class]{BinarySearchTree}-[func]{getInOrderNext}
```
=== "Python"
```python title="binary_search_tree.py"
[class]{BinarySearchTree}-[func]{remove}
[class]{BinarySearchTree}-[func]{get_inorder_next}
```
=== "Go"
```go title="binary_search_tree.go"
[class]{binarySearchTree}-[func]{remove}
[class]{binarySearchTree}-[func]{getInOrderNext}
```
=== "JavaScript"
```javascript title="binary_search_tree.js"
[class]{}-[func]{remove}
[class]{}-[func]{getInOrderNext}
```
=== "TypeScript"
```typescript title="binary_search_tree.ts"
[class]{}-[func]{remove}
[class]{}-[func]{getInOrderNext}
```
=== "C"
```c title="binary_search_tree.c"
[class]{binarySearchTree}-[func]{remove}
[class]{binarySearchTree}-[func]{getInOrderNext}
```
=== "C#"
```csharp title="binary_search_tree.cs"
[class]{BinarySearchTree}-[func]{remove}
[class]{BinarySearchTree}-[func]{getInOrderNext}
```
=== "Swift"
```swift title="binary_search_tree.swift"
[class]{BinarySearchTree}-[func]{remove}
[class]{BinarySearchTree}-[func]{getInOrderNext}
```
=== "Zig"
```zig title="binary_search_tree.zig"
[class]{BinarySearchTree}-[func]{remove}
[class]{BinarySearchTree}-[func]{getInOrderNext}
```
### 排序