标签:nbsp har 赋值 child creat node scan tchar div
int main(){ BinTree tree,parent,child; char ch[maxsize]; int i,n=0,k=0,j; printf("请给赋值二叉树:\n"); for(i=0;i<maxsize;i++){ scanf("%c",&ch[i]); if(ch[i]==‘\n‘) break; } createBinTree(tree,ch,n); printf("用广义表输出二叉树为:\n"); PrintfBintree(tree); printf("\n"); printf("叶子结点为:\n"); PrintfLeafNode(tree,k); printf("\n"); printf("叶子结点个数为:%d",k); printf("\n"); printf("请输入任意结点:"); parent=(BiTNode*) malloc(sizeof(BiTNode)); scanf("%c",&parent->data); printf("双亲结点为:%c",getParent(tree,parent)->data); printf("\n"); child=(BiTNode*) malloc(sizeof(BiTNode)); printf("请输入任意结点:"); getchar(); scanf("%c",&child->data); printf("孩子结点为:"); child=Search(tree,child); printfChild(child); }
标签:nbsp har 赋值 child creat node scan tchar div
原文地址:https://www.cnblogs.com/Maxsh/p/10986314.html