/// <summary> /// BuildBT istantiates a BinaryTree, and adds nodes to it, then logs all of the traverses /// </summary> public static void BuildBT() { BinaryTree BT = new BinaryTree(new Node(5)); BT.Root.LeftChild = new Node(8); BT.Root.RightChild = new Node(3); BT.Root.LeftChild.LeftChild = new Node(9); BT.Root.RightChild.LeftChild = new Node(10); BT.Root.RightChild.RightChild = new Node(11); // InOrder should be 9-8-5-10-3-11 BT.InOrder(BT.Root); // PreOrder should be 5-8-9-3-10-11 BT.PreOrder(BT.Root); // PostOrder should be 9-8-10-11-3-5 BT.PostOrder(BT.Root); // Breadth should be 5-8-3-9-10-11 BT.BreadthFirst(BT.Root); }