序穿线二叉树.docVIP

  • 1
  • 0
  • 约2.38千字
  • 约 3页
  • 2019-07-02 发布于江西
  • 举报
#includeiostream using namespace std; templateclass T struct TBtnode { T d; int lflag; int rflag; TBtnode *lchild; TBrnode *rchild; }; templateclass T class InTBinaryTree { private: TBtnodeT *BT; public: InTBinaryTree() {BT=NULL;return;} void CreateBinaryTree(T); void CreateInTBinaryTree(); void InTTree(); }; templateclass T void InTBinaryTreeT::CreateBinaryTree(T end) { TBtnodeT *p; T x; cinx; if(x==end) return; p=new TBtnodeT; p-d=x;p-lchild=NULL;p-rchild=NULL;p-lflag=0;p-rflag=0; BT=p; Create(p,1,end); Create(p,2,end); return; } templateclass T static Create

文档评论(0)

1亿VIP精品文档

相关文档