面试题5:重建二叉树 (二)
)
{
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;
}
| 评论 |
|
|