0001 template <typename T> BinNodePosi<T> BinTree<T>::insert ( T const& e ) 0002 { _size = 1; return _root = new BinNode<T> ( e ); } //将e当作根节点插入空的二叉树 0003 0004 template <typename T> BinNodePosi<T> BinTree<T>::insert ( T const& e, BinNodePosi<T> x ) 0005 { _size++; x->insertAsLC ( e ); updateHeightAbove ( x ); return x->lc; } //e插入为x的左孩子 0006 0007 template <typename T> BinNodePosi<T> BinTree<T>::insert ( BinNodePosi<T> x, T const& e ) 0008 { _size++; x->insertAsRC ( e ); updateHeightAbove ( x ); return x->rc; } //e插入为x的右孩子