Program in Java using binary search tree