|
using System;
using BinaryTreeLibrary;
public class TreeTest
{
public static void Main(string[] args)
{
Tree tree = new Tree();
int insertValue;
Console.WriteLine("Inserting Values: ");
Random random = new Random();
for (int i = 1; i <= 10; i++)
{
insertValue = random.Next(100);
Console.Write(insertValue + " ");
tree.insertNode(insertValue);
}
Console.WriteLine("\n\nPreorder traversal");
tree.PreorderTraversal();
Console.WriteLine("\n\nInorder traversal");
tree.InorderTraversal();
Console.WriteLine("\n\nPostorder traversal");
tree.PostorderTraversal();
Console.WriteLine();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.