面试题5:重建二叉树 (二)

2014-11-23 22:30:51 · 作者: · 浏览: 12
) { int nPreOrderArr[8] = {1,2,4,7,3,5,6,8}; int nInOrderArr[8] = {4,7,2,1,5,3,8,6}; BiTreeNode *pRoot = CreateBiTreeByPreorderAndInorder(nPreOrderArr, nInOrderArr,8); cout << "先序序列:"; PreOrderPrint(pRoot); cout << endl; cout << "后序序列:"; InOrderPrint(pRoot); cout << endl; system("pause"); return 0; }