Modified the BST

it is failing if cases are more than 1


Please help!