一. 二叉树的节点代码 struct BiNode { int data; BiNode* rchild, * lchild; }; typedef BiNode* BiTree; 二. 二叉树的创建 2.1 递归创建 void CreateBitreeRecur(BiTree* T) { int ch; scanf("%d", &ch); if (ch == 0) { *T = NULL; } else { *T = new(BiNode); (*T)->data = ch; CreateBitreeRecur(&(*T)->lchild); CreateBitreeRecur(&(*T)->rchild); } } 2.2 层次创建 BiTree CreateBiTree(int a[], int n) { deque<BiNode*> que; BiNode* p; BiNode* root; int front = 1, rear = 1; for (int i = 0; i <n; i++) //建立节点,将节点存入队列 { if (a[i] == 0) { p = NULL; } else