What happens if there are nodes with equal values


  • 0
    Q

    It seems that the test cases do not have nodes with equal values.
    What happens if there are nodes with equal values?


  • 1
    W

    It's a binary search tree, there should never be duplicates.


  • 0
    Q

    I know that it is the common practice.
    But it really depends on your definition of BST.

    I am wondering how to solve the problem if the BST allows duplicates.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.