《算法导论》笔记3-12
二叉搜索树
递归查找:
1 | tree_search(root, k) |
迭代查找:
1 | tree_search(root, k) |
最大关键字元素和最小关键字元素:
1 | tree_min(root) |
1 | tree_max(root) |
插入:
1 | tree_insert(T, node) |
删除:
1 | transplant(T, root, child) |
1 | tree_delete(T, node) |
递归查找:
1 | tree_search(root, k) |
迭代查找:
1 | tree_search(root, k) |
最大关键字元素和最小关键字元素:
1 | tree_min(root) |
1 | tree_max(root) |
插入:
1 | tree_insert(T, node) |
删除:
1 | transplant(T, root, child) |
1 | tree_delete(T, node) |