KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > longrunning > Tree


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest.longrunning;
5
6
7 public class Tree {
8   private Tree[] children;
9
10   public void makeTree(int breadth, int depth) {
11     children = new Tree[breadth];
12     if (depth < 1) return;
13     for (int b = 0; b < breadth; b++) {
14       children[b] = new Tree();
15       children[b].makeTree(breadth, depth -1);
16     }
17   }
18 }
Popular Tags