Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.Title = "Guids and implementation examples for most popular types of Data Structures v1.0";

            var stackRun            = new StackRun();
            var queueRun            = new QueueRun();
            var setRun              = new SetRun();
            var hashTableRun        = new HashTableRun();
            var mapRun              = new MapRun();
            var listRun             = new ListRun();
            var treeRun             = new TreeRun();
            var heapRun             = new HeapRun();
            var binarySearchTreeRun = new BinarySearchTreeRun();
            var graphRun            = new GraphRun();

            while (true)
            {
                Console.Clear();
                GetBasicInfo();

                Console.Write("\nClick on a specific button: ");
                var key = Console.ReadKey();
                Console.WriteLine();

                switch (key.Key)
                {
                case ConsoleKey.S:
                {
                    BeginStack(stackRun);
                }
                break;

                case ConsoleKey.Q:
                {
                    BeginQueue(queueRun);
                }
                break;

                case ConsoleKey.E:
                {
                    BeginSet(setRun);
                }
                break;

                case ConsoleKey.B:
                {
                    BeginHashTable(hashTableRun);
                }
                break;

                case ConsoleKey.M:
                {
                    BeginMap(mapRun);
                }
                break;

                case ConsoleKey.L:
                {
                    BeginList(listRun);
                }
                break;

                case ConsoleKey.T:
                {
                    BeginTree(treeRun);
                }
                break;

                case ConsoleKey.H:
                {
                    BeginHeap(heapRun);
                }
                break;

                case ConsoleKey.N:
                {
                    BeginBinarySearchTree(binarySearchTreeRun);
                }
                break;

                case ConsoleKey.G:
                {
                    BeginGraph(graphRun);
                }
                break;

                case ConsoleKey.X:
                {
                    Environment.Exit(0);
                }
                break;
                }
            }
        }
Ejemplo n.º 2
0
 static void BeginHeap(HeapRun heapRun)
 {
     Console.Clear();
     heapRun.ImplementedHeap();
     PressAnyKey();
 }