Name

bistree_destroy

Synopsis

void bistree_destroy(BisTree *tree);

Return Value

None.

Description

Destroys the binary search tree specified by tree. No other operations are permitted after calling bistree_destroy unless bistree_init is called again. The bistree_destroy operation removes all nodes from a binary search tree and calls the function passed as destroy to bistree_init once for each node as it is removed, provided destroy was not set to NULL.

Complexity

O (n), where n is the number of nodes in the binary search tree.

Get Mastering Algorithms with C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.