diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-07-06 21:35:17 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-07-08 11:04:33 -0400 |
commit | 1ec57ef8df39b2ad7af98e2e65d93a60e7851586 (patch) | |
tree | dbd1c4aaa877984381d5e63c1fafbb6cfb9914f9 | |
parent | 005c0514d3caf2b76bb563136ef6496716f43ebb (diff) |
Add balance factor computation for map nodes
-rw-r--r-- | collections/map/map.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; { |