Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public final class Test
- {
- Test left;
- Test right;
- static Test CreateTree(int n)
- {
- if(n <= 0) return null;
- Test t = new Test();
- t.left = CreateTree(n - 1);
- t.right = CreateTree(n - 1);
- return t;
- }
- public static void main( String[] arg )
- {
- long start = System.currentTimeMillis();
- for(int i = 0;i < 15;i++)
- {
- CreateTree(22);
- System.gc();
- }
- long end = System.currentTimeMillis();
- System.out.println( "Time: " + ( end - start ) + " ms" );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement