void visit(Node *pRoot) { cout<<pRoot->value<<endl; } void PreOrderTraverse(Node *pRoot) { if (!pRoot) return; visit(pRoot); PreOrderTraverse(pRoot->pLeft); PreOrderTraverse(pRoot->pRight); }
EOF
void visit(Node *pRoot) { cout<<pRoot->value<<endl; } void PreOrderTraverse(Node *pRoot) { if (!pRoot) return; visit(pRoot); PreOrderTraverse(pRoot->pLeft); PreOrderTraverse(pRoot->pRight); }
EOF