Exemple #1
0
        // Show the tree's traversals.
        private void ShowTraversals()
        {
            Traversal = new List <string>();
            Root.PreorderTraverse(MakeTraversal);
            preorderTextBox.Text = string.Join(", ", Traversal.ToArray());

            Traversal = new List <string>();
            Root.InorderTraverse(MakeTraversal);
            inorderTextBox.Text = string.Join(", ", Traversal.ToArray());

            Traversal = new List <string>();
            Root.PostorderTraverse(MakeTraversal);
            postorderTextBox.Text = string.Join(", ", Traversal.ToArray());

            Traversal = new List <string>();
            Root.BreadthFirstTraverse(MakeTraversal);
            breadthFirstTextBox.Text = string.Join(", ", Traversal.ToArray());
        }