Guest User

Untitled

a guest
Oct 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. /*void passRoot(){
  2. cout << "INORDER: " << endl;
  3. inorder(root);
  4. cout << "POSTORDER" << endl;
  5. postorder(root);
  6. }
  7.  
  8. void inorder(BSTNode<Data> * node) const{
  9. if(node->left != NULL)
  10. inorder(node->left);
  11. cout << node->data << endl;
  12. if(node->right != NULL)
  13. inorder(node->right);
  14. }
  15.  
  16. void postorder(BSTNode<Data> *node) const{
  17. if(node->left != NULL)
  18. inorder(node->left);
  19. if(node->right != NULL)
  20. inorder(node->right);
  21. cout << node->data << endl;
Add Comment
Please, Sign In to add comment