资 源 简 介
#ifndef _BINARY_TREE_H_INCLUDED#define _BINARY_TREE_H_INCLUDED#include #include templatestruct Bintree_node {T element;Bintree_node* lchild;Bintree_node* rchild;explicit Bintree_node(const T& elem=T(), Bintree_node* lchd=0, Bintree_node* rchd=0): element(elem), lchild(lchd), rchild(rchd) {}};templateclass Binary_tree {public:typedef Bintree_node* PBtn;Binary_tree();virtual ~Binary_tree();void clear();int depth() const;int size() const;virtual PBtn find(const T& elem) const=0;virtual void insert(const T& elem)=0;virtual void erase(const T& elem)=0;virtual void print(std::ostream& output) const=0;void print_tree(std::ostream& output) const;protected: