โ† Amazon questions

Find node pairs with sum k in BST in O(n) time and constant space

Filed under Amazon

Given a Binary Search Tree (BST) of n nodes, find all pairs of nodes whose sum equals a given number k in O(n) time and constant auxiliary space.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.