public class TreeNodeLab { private static TreeNode getTree() { /* * Represent this: * * . * / \ * / \ * / \ * / \ * The Dog * / \ / * / \ Lazy * Brown Over * / \ / \ * The Quick Fox Jumps * */ TreeNode the1 = new TreeNode("The"); TreeNode quick = new TreeNode("Quick"); TreeNode brown = new TreeNode("Brown", the1, quick); TreeNode fox = new TreeNode("Fox"); TreeNode jumps = new TreeNode("Jumps"); TreeNode over = new TreeNode("Over", fox, jumps); TreeNode the2 = new TreeNode("The", brown, over); TreeNode lazy = new TreeNode("Lazy"); TreeNode dog = new TreeNode("Dog", lazy, null); return new TreeNode("", the2, dog); } public static void main(String[] args) { TreeNode root = getTree(); System.out.println("Sentence: " + root.toString()); } }