08 2019 档案
摘要://判定一棵二叉树是否为完全二叉树 bool Is(BiTree b) { InitQueue(Q); BiTree p; if(b==NULL) //空树为满二叉树 return true; EnQueue(Q,b);//将根节点入队 while(!IsEmpty(Q)) //如果队列不为空 { DeQueue(Q...
阅读全文
摘要:#include typedef struct BTNode { char data; struct BTNode * lchild; //p是指针L是左,child是孩子 struct BTNode * rchild; }BTNode,*BiTree; struct BTNode * CreateBTree(); void PreTraverseBTree(str...
阅读全文
摘要:#include #include #include #include struct BiTNode { int data; struct TreeNode *lchild,*rchild; }BiTNode, *BiTree; //输出二叉树的所有结点个数 int Put(BiTree b) { if(b==NULL) ...
阅读全文