思想:递归思想
#include <string>
void PreTree(BitPointer roots){
if (NULL!=roots){
printf("%c",roots->c);
PreTree(roots->LChild);
PreTree(roots->RChild);
}
}
//中序遍历
void InTree(BitPointer roots){
if (NULL!=roots){
InTree(roots->LChild);
printf("%c",roots->c);
InTree(roots->RChild);
}
}
//后序遍历
void PostTree(BitPointer roots){
if (roots!=NULL){
PostTree(roots->LChild);
PostTree(roots->RChild);
printf("%c",roots->c);
}
}