Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 395 Bytes

File metadata and controls

13 lines (7 loc) · 395 Bytes

142.Two Sum IV - Input is a BST

Description

Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.

Note

Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?

From

LeetCode