8 ms·
You have to know the root of the tree to do anything: void *tsearch(const void *key, void **rootp, int (*compar)(const vo
by geophile 6y ago
You have to know the root of the tree to do anything:
void *tsearch(const void *key, void **rootp,
int (*compar)(const void *, const void *));
void *tfind(const void *key, void *const *rootp,
int (*compar)(const void *, const void *));
...
rootp points to a variable which points to the root of the tree.
You can't operate on a tree unless you have a pointer to it, i.e., it's root.