#include <stdio.h> typedef struct BinTree{ int data; struct BinTree *left; struct BinTree *right; }BinTree; void PreOrder(BinTree *root){ if(root == NULL) return; BinTree *p = root; printf("%d\n", p->data); PreOrder(p->left); PreOrder(p->right); } void InOrder(BinTree *root){ if(root == NULL) return; BinTree *p = root; InOrder(p->left); printf("%d\n", p->data); InOrder(p->right); } void PostOrder(BinTree *root){ if(root==NULL) return; BinTree *p = root; PostOrder(p->left); PostOrder(p->right); printf("%d\n", p->data); } void CreateBinTree(BinTree *root){ } int main(){ return 0; }
原文:http://www.cnblogs.com/fangying7/p/4721546.html