Interface of the Binary Search Tree Module

Source: Internet
Author: User
/*_##################################### #######################################
_##
### Interface of the Binary Search Tree Module
_ ## Author: xwlee
_ ## Time: 2007.01.01
### Chang'an University
_ ## Development condition: win2003 SERVER + vc6.0
_##
_ ## Bsearchtree. h file
_####################################### ###################################*/

// Tree element type.
# Define tree_type int

// -------------------------- External interface -------------------------------
// Add a new value to the tree. The parameter must not exist in the tree.
Void insert (tree_type value );

// Find a specific value. The function returns a pointer to this value.
Tree_type * Find (tree_type value );

// The execution tree's forward traversal. Its parameter is a callback function pointer, and the function to which it points will
// It is called to process each node in the tree. The Node value is passed to this function as a parameter.
Void pre_order_traverse (void (* callback) (tree_type value ));

// The execution tree's ordinal traversal. Its parameter is a callback function pointer, and the function to which it points will
// It is called to process each node in the tree. The Node value is passed to this function as a parameter.
Void mid_order_traverse (void (* callback) (tree_type value ));

// The post-order traversal of the execution tree. Its parameter is a callback function pointer, and the function to which it points will
// It is called to process each node in the tree. The Node value is passed to this function as a parameter.
Void back_order_traverse (void (* callback) (tree_type value ));

// -------------------------- External interface -------------------------------

// Temporary Function
Void treeprint ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.