From 1ec57ef8df39b2ad7af98e2e65d93a60e7851586 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Mon, 6 Jul 2020 21:35:17 -0400 Subject: Add balance factor computation for map nodes --- collections/map/map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/collections/map/map.c b/collections/map/map.c index f61e8ef..b21ed32 100644 --- a/collections/map/map.c +++ b/collections/map/map.c @@ -26,6 +26,12 @@ map *root; return 1 + ( l > r ? l : r); } +int map_bal_factor(root) +map *root; +{ + return map_height(root->right) - map_height(root->left); +} + map* map_new(cmp) cmp_func cmp; { -- cgit v1.1