Hi guys am creating a Binary Search Tree Program so far it works fine and everything but I am trying to arrange the random numbers generated after the in order transversal in ascending order here is my code
// C
// This Binary Search Program inputs 25 Random workers and outputs them in different orders.
using System;
using BinaryTreeLibrary;
// class TreeTest declaration
public class TreeTest
{
// test class Tree
static void Main( string[] args )
{
Tree tree = new Tree();
int insertValue;
Console.WriteLine( "Inserting values: " );
Random random = new Random();
// insert 25 random integers from 0-99 in tree
for ( int i = 1; i <= 25; i++ )
{
insertValue = random.Next( 100 );
Console.Write( insertValue + " " );
tree.InsertNode( insertValue );
} // end for
// perform inorder traversal of tree
Console.WriteLine("\n\nInorder traversal");
tree.InorderTraversal();
// Sort Random???
// perform preorder traversal of tree
Console.WriteLine( "\n\nPreorder traversal" );
tree.PreorderTraversal();
// perform postorder traversal of tree
Console.WriteLine( "\n\nPostorder traversal" );
tree.PostorderTraversal();
} // end method Main
} // end class TreeTest