find distance from nodes in BST