# augmenting bst - is there exist pair (a,b) of numbers such that |b-a| = d?

How to check if exist pair $(a,b)$ of numbers in BST such that $|a-b| = d$, where $d$ is given.
Example:
contain of tree: $1, 4, 5, 3, 8, 45, 532$
$d=5$,
answer: $yes$, there is pair $(5,8)$
$d=52$
answer: $no$.

I can solve it when number are in array - then I sort them, and in linear time I can find that pair. Neverthelress I can't idea how to augment BST in this task.
Can you give me a hint ?