summaryrefslogtreecommitdiff
path: root/src/03/avl_tree.h
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-08-27 14:25:24 -0600
committermo khan <mo.khan@gmail.com>2020-08-27 14:25:24 -0600
commitbb5614b28291209b0353a5e63992ef8823722efd (patch)
tree2a37957627aa760fecf20fd80bfa321042fa743a /src/03/avl_tree.h
parente040e02be99542465affa55e2676b1b6ce938133 (diff)
Implement a right rotation
Diffstat (limited to 'src/03/avl_tree.h')
-rw-r--r--src/03/avl_tree.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/03/avl_tree.h b/src/03/avl_tree.h
index b4a67f6..189d33c 100644
--- a/src/03/avl_tree.h
+++ b/src/03/avl_tree.h
@@ -1,13 +1,11 @@
typedef struct node {
struct node *left;
struct node *right;
+ int height;
int value;
-} AVLNode;
-
-typedef struct {
- AVLNode *root;
} AVLTree;
-AVLTree *avl_tree_init(void);
+AVLTree *avl_tree_initialize(int value);
int avl_tree_size(AVLTree *tree);
-void avl_tree_insert(AVLTree *tree, int value);
+AVLTree *avl_tree_insert(AVLTree *tree, int value);
+void avl_tree_inspect(AVLTree *tree);