二叉树的三种遍历方式(递归)先根中根后根
1void preOrder(BinTree tree){ if(tree == NULL){ return ; } visit(tree); preOrder(tree->leftNode); preOrder(tree->rightNode); 8}
1void inOrder(BinTree tree){ if(tree == NULL){ return ; } inOrder(tree->leftNode); visit(tree); inOrder(tree->rightNode); 8}
1void postOrder(BinTree tree){ if(tree == NULL){ return ; } postOrder(tree->leftNode); postOrder(tree->rightNode); visit(tree); 8}