Upper Bound Using Binary Search Tree