Click here to see the full article post
Approach #2 : Space complexity should be O(n). The size of the set+queue can grow upto n in the worst case.
@zestypanda I've updated the article. Thanks for the valuable feedback.
@aayushgarg You're right. Thanks for pointing out.
@vinod23 whats your take on converting the BST to doubly linked list and then find the two sum.
@kool This cannot be done in O(n) time and O(logN) space. What if height of my BST is N?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.