正在加载图片...
#include iostream. h> template< class Type> class bst;∥叉搜索树类的前视声明 template <class Type> class BstNode: public BinTreeNode ∥二叉搜索树结点类的定义。二叉搜索树的结点类是一般二叉树结点 /(的公有继承 friend class bst< Type>;/叉搜索树类是二叉搜索树结点类的友元类 public BstNode() leftChild( null ) rightChild( NULL)() BstNode( const type d) data( d ), leftchild( NULL), right Child( null)i BstNode( const Type d=0, BstNode *L-NULL, BstNode x R-NULL ) data( d), leftchild( L), rightChild(r)j BstNode(i protected pe BstNode< type>* leftchild, right Child 20212222021/2/22 18 #include < iostream . h > template <class Type> class BST ; //二叉搜索树类的前视声明 template <class Type> class BstNode : public BinTreeNode //二叉搜索树结点类的定义。二叉搜索树的结点类是一般二叉树结点 //类的公有继承 { friend class BST<Type>;//二叉搜索树类是二叉搜索树结点类的友元类 public: BstNode( ) : leftChild( NULL ),rightChild( NULL ) { } BstNode( const Type d ) : data( d ), leftChild( NULL ) , rightChild( NULL ) { } BstNode( const Type d=0 , BstNode * L=NULL , BstNode * R=NULL ) : data( d ), leftChild( L ), rightChild( R ) { } ~BstNode( ) { } protected : Type data ; BstNode<Type> * leftChild , * rightChild ; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有