search: add comments to tsearch_avl.c
This commit is contained in:
parent
d197d6421c
commit
6255c4c6a5
1 changed files with 6 additions and 0 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <search.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 {
|
struct node {
|
||||||
const void *key;
|
const void *key;
|
||||||
struct node *left;
|
struct node *left;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue