• Source
    1. BstNode* Insert(BstNode* root, int data)
    2. {
    3. if(root==NULL)
    4. {
    5. root = GetNewNode(data);
    6. }
    7. else if(data <= root->data)
    8. {
    9. root->left = Insert(root->left, data);
    10. }
    11. else
    12. {
    13. root->right = Insert(root->right, data);
    14. }
    15. return root;
    16. }