aboutsummaryrefslogtreecommitdiff
path: root/collections/map/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'collections/map/map.c')
-rw-r--r--collections/map/map.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/collections/map/map.c b/collections/map/map.c
index 747d6ce..f5751b5 100644
--- a/collections/map/map.c
+++ b/collections/map/map.c
@@ -37,6 +37,32 @@ struct map_node *root;
return map_height(root->right) - map_height(root->left);
}
+void map_rotate_left(node)
+struct map_node **node;
+{
+ struct map_node *tmp;
+
+ tmp = *node;
+ *node = tmp->right;
+ tmp->right = (*node)->left;
+ (*node)->left = tmp;
+
+ return;
+}
+
+void map_rotate_right(node)
+struct map_node **node;
+{
+ struct map_node *tmp;
+
+ tmp = *node;
+ *node = tmp->left;
+ tmp->left = (*node)->right;
+ (*node)->right = tmp;
+
+ return;
+}
+
map* map_new(cmp)
cmp_func cmp;
{