Skip to content

Instantly share code, notes, and snippets.

@claymccoy
Created August 18, 2008 15:06
Show Gist options
  • Save claymccoy/5976 to your computer and use it in GitHub Desktop.
Save claymccoy/5976 to your computer and use it in GitHub Desktop.
final TreeNode shape = new TreeNode("shape");
final TreeNode ellipse = new TreeNode("ellipse");
shape.addChild(ellipse);
ellipse.addChild(new TreeNode("circle"));
final TreeNode polygon = new TreeNode("polygon");
shape.addChild(polygon);
final TreeNode triangle = new TreeNode("triangle");
polygon.addChild(triangle);
triangle.addChild(new TreeNode("equilateral"));
triangle.addChild(new TreeNode("isosceles"));
triangle.addChild(new TreeNode("scalene"));
final TreeNode quad = new TreeNode("quadrilateral");
polygon.addChild(quad);
final TreeNode rectangle = new TreeNode("rectangle");
quad.addChild(rectangle);
rectangle.addChild(new TreeNode("square"));
polygon.addChild(new TreeNode("petagon"));
polygon.addChild(new TreeNode("hexagon"));
polygon.addChild(new TreeNode("googolgon"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment