Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef BINARYTREE_H
- #define BINARYTREE_H
- typedef int ( *SWO_t )( const void *, const void * );
- struct BinaryTreeNode;
- typedef struct {
- struct BinaryTreeNode *root;
- size_t count;
- SWO_t comes_before;
- } BinaryTree;
- // Lifecycle operations...
- void BinaryTree_construct( BinaryTree *object, SWO_t strict_weak_ordering );
- void BinaryTree_destroy( BinaryTree *object );
- // Non-modifying tree operations...
- size_t BinaryTree_size( const BinaryTree *object );
- const void *BinaryTree_min( const BinaryTree *object );
- const void *BinaryTree_max( const BinaryTree *object );
- const void *BinaryTree_lookup( const BinaryTree *object, const void *item );
- // Modifying tree operations...
- void BinaryTree_insert( BinaryTree *object, const void *item );
- void BinaryTree_delete( BinaryTree *object, const void *item );
- // Debugging operations...
- int BinaryTree_invariant( const BinaryTree *object );
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement