Name

bistree_lookup

Synopsis

int bistree_lookup(const BisTree *tree, void **data);

Return Value

0 if the data is found in the binary search tree, or -1 otherwise.

Description

Determines whether a node matches data in the binary search tree specified as tree. If a match is found, data points to the matching data in the binary search tree upon return.

Complexity

O (lg 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.