• Source
    1. void printPreOrder(BstNode* root)
    2. {
    3. if(root==NULL)
    4. {
    5. return;
    6. }
    7.  
    8. printf("%d ", root->data);
    9.  
    10. printPreOrder(root->left);
    11.  
    12. printPreOrder(root->right);
    13. }
    14.  
    15. void printInOrder(BstNode* root)
    16. {
    17. if(root==NULL)
    18. {
    19. return;
    20. }
    21.  
    22. printInOrder(root->left);
    23.  
    24. printf("%d ", root->data);
    25.  
    26. printInOrder(root->right);
    27. }
    28.  
    29. void printPostOrder(BstNode* root)
    30. {
    31. if(root==NULL)
    32. {
    33. return;
    34. }
    35.  
    36. printPostOrder(root->left);
    37.  
    38. printPostOrder(root->right);
    39.  
    40. printf("%d ", root->data);
    41. }