Solution to find next node in BST