Update rbtree.h

This commit is contained in:
AryanYu 2023-09-29 14:32:03 +08:00
parent 2b1325b00d
commit 4aceaff0c0
1 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ typedef struct rb_root{
Node *node;
}RBRoot;
// 创建红黑树,返回"红黑树的根"
// 创建红黑树
RBRoot* create_rbtree();
// 销毁红黑树
@ -40,14 +40,14 @@ void inorder_rbtree(RBRoot *root);
// 后序遍历"红黑树"
void postorder_rbtree(RBRoot *root);
// (递归实现)查找"红黑树"中键值为key的节点。找到的话返回0否则返回-1。
// 递归查找键值为key的节点。找到返回0找不到返回-1
int rbtree_search(RBRoot *root, Type key);
// (非递归实现)查找"红黑树"中键值为key的节点。找到的话返回0否则返回-1。
// 非递归查找键值为key的节点。找到返回0找不到返回-1
int iterative_rbtree_search(RBRoot *root, Type key);
// 返回最小结点的值(将值保存到val中)。找到的话返回0否则返回-1。
// 返回最小结点的值存于val找到返回0找不到返回-1
int rbtree_minimum(RBRoot *root, int *val);
// 返回最大结点的值(将值保存到val中)。找到的话返回0否则返回-1。
// 返回最大结点的值(保存于val)。找到返回0找不到返回-1
int rbtree_maximum(RBRoot *root, int *val);
// 打印红黑树