public class PrintDepth { private static int printdepth; // The depth to print all the elements. public static void main(String [] args) { MyTree T = new MyTree(); // Gets a Tree object. TreeNode root = T.getRoot(); // Gets the root of the tree. printdepth = 111; // sets the tree to depth 111. } }
public class TreeNode { public int key; public TreeNode left; public TreeNode right; public TreeNode(int _key, TreeNode l, TreeNode r) { key = _key; left = l; right = r; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)