summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012-05-13 01:50:53 +0200
committernsz <nsz@port70.net>2012-05-13 01:50:53 +0200
commit6255c4c6a5599724d18311a7776aebe67f8e6d4a (patch)
treea308c757f85b654fd8061c250938bcb6b50f9dcb
parentd197d6421c317145e2aff89dd41de9d03eeaa00b (diff)
downloadmusl-6255c4c6a5599724d18311a7776aebe67f8e6d4a.tar.gz
musl-6255c4c6a5599724d18311a7776aebe67f8e6d4a.tar.bz2
musl-6255c4c6a5599724d18311a7776aebe67f8e6d4a.tar.xz
musl-6255c4c6a5599724d18311a7776aebe67f8e6d4a.zip
search: add comments to tsearch_avl.c
-rw-r--r--src/search/tsearch_avl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/search/tsearch_avl.c b/src/search/tsearch_avl.c
index f5c2cf61..b56159b9 100644
--- a/src/search/tsearch_avl.c
+++ b/src/search/tsearch_avl.c
@@ -1,6 +1,12 @@
#include <stdlib.h>
#include <search.h>
+/*
+avl tree implementation using recursive functions
+the height of an n node tree is less than 1.44*log2(n+2)-1
+(so the max recursion depth in case of a tree with 2^32 nodes is 45)
+*/
+
struct node {
const void *key;
struct node *left;