diff options
-rw-r--r-- | collections/map/map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/collections/map/map.c b/collections/map/map.c index cbb3b79..a1c7798 100644 --- a/collections/map/map.c +++ b/collections/map/map.c @@ -34,6 +34,9 @@ struct map_node *root; int map_bal_factor(root) struct map_node *root; { + if (!root) + return 0; + return map_height(root->right) - map_height(root->left); } |