Function tbst_create() is the same as bst_create() except that a
struct tbst_table has no generation number to fill in.
252. <TBST creation function 252> =
struct tbst_table *
tbst_create (tbst_comparison_func *compare, void *param,
struct libavl_allocator *allocator)
{
struct tbst_table *tree;
assert (compare != NULL);
if (allocator == NULL)
allocator = &tbst_allocator_default;
tree = allocator->libavl_malloc (allocator, sizeof *tree);
if (tree == NULL)
return NULL;
tree->tbst_root = NULL;
tree->tbst_compare = compare;
tree->tbst_param = param;
tree->tbst_alloc = allocator;
tree->tbst_count = 0;
return tree;
}
7.3 Operations
|
7 Threaded Binary Search Trees
|
7.5 Search
|