Advertisement
Guest User

GG

a guest
Apr 12th, 2008
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1.  public final class Test
  2. {
  3.  Test left;
  4.  Test right;
  5.  
  6.  static Test CreateTree(int n)
  7.  {
  8.   if(n <= 0) return null;
  9.   Test t = new Test();
  10.   t.left = CreateTree(n - 1);
  11.   t.right = CreateTree(n - 1);
  12.   return t;
  13.  }
  14.  
  15.  public static void main( String[] arg )
  16.  {
  17.   long start = System.currentTimeMillis();
  18.   for(int i = 0;i < 15;i++)
  19.   {
  20.    CreateTree(22);
  21.    System.gc();
  22.   }
  23.   long end = System.currentTimeMillis();
  24.   System.out.println( "Time: " + ( end - start ) + " ms" );
  25.  }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement