// 13-1.h
#include <iostream>
namespace binarySearchTree
{
typedef int Item ;
typedef struct node
{
Item item ;
struct node * left, * right ;
} Node ;
class BinarySearchTree
{
private:
Node * m_root ;
int m_current ;
Node * m_MakeNode (const Item & item) ;
void m_PrecedingOrderTreversal (const Node * const pn) const ;
void m_IntermediateOrderTraversal (const Node * const pn) const ;
void m_HindOrderTraversal (const Node * const pn) const ;
void m_Release (const Node * const pn) ;
void m_Copy (const Node * const pn) ;
Item m_FindMin (const Node * pRight) const ;
public:
BinarySearchTree (void) ;
BinarySearchTree (const BinarySearchTree & t) ;
Item FindMin (void) const ;
Item FindMax (void) const ;
int Count (void) const ;
bool IsEmpty (void) const ;
bool Find (const Item & item) const ;
bool Insert (const Item & item) ;
bool Delete (const Item & item) ;
void PrecedingOrderTrevers
C++ 二叉搜索树头文件
最新推荐文章于 2023-04-23 23:44:35 发布