Difference between this problem with LCA of BST?


  • 0
    S

    I just use the same code for both problem.


  • 8

    Then your solution is probably not very good for the BST version of the problem. If you do take advantage of the BST-property, you can have a better solution. This is all speculative, of course, as I don't know your solution.


  • 0
    S

    Yes, I realized that BST version could have O(logn) solution.


Log in to reply
 

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