ucx/avl.c

changeset 199
e25dc68336ec
parent 197
a82f3456b76d
child 202
4c84dd2408d7
     1.1 --- a/ucx/avl.c	Mon May 18 19:12:32 2015 +0200
     1.2 +++ b/ucx/avl.c	Mon May 18 19:49:03 2015 +0200
     1.3 @@ -214,3 +214,14 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +static size_t ucx_avl_countn(UcxAVLNode *node) {
     1.8 +    if (node) {
     1.9 +        return 1 + ucx_avl_countn(node->left) + ucx_avl_countn(node->right);
    1.10 +    } else {
    1.11 +        return 0;
    1.12 +    }
    1.13 +}
    1.14 +
    1.15 +size_t ucx_avl_count(UcxAVLTree *tree) {
    1.16 +    return ucx_avl_countn(tree->root);
    1.17 +}

mercurial