public void insert( AnyType x ) { root = insert(
x, root ); }
so that it doesn't use the private recursive method:
private BinaryNode<AnyType> insert( AnyType x, BinaryNode<AnyType> t )
{ .... }
Instead, the public version of insert should use a while-loop to search for the element. Note that there should be no use of recursion in this public method.
time = (double) ( System.currentTimeMillis( ) );
//whatever it is you want to time
time = (double) ( System.currentTimeMillis( ) ) - time;