No run-time tradeoffs are mentioned


  • 0
    V

    This problem does not mention if implementation should support faster add or find or if both operations are equally likely. I've solution of balanced binary tree which performs add in O(logn) and does find using in-order and reverse in-order in O(logn) time complexity. The auxilary space complexity is O(logn) used by stacks in traversing tree while finding.


Log in to reply
 

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