merge partial leaf nodes for each binary search tree with recursion