예제 #1
0
        static void BeginList(ListRun listRun)
        {
            Console.Clear();
            GetListInfo();
            Console.Write("\nClick on a specific button: ");
            var key = Console.ReadKey();

            Console.WriteLine();

            switch (key.Key)
            {
            case ConsoleKey.B:
            {
                Console.Clear();
                listRun.BasicList();
                PressAnyKey();
            }
            break;

            case ConsoleKey.L:
            {
                Console.Clear();
                listRun.BasicLinkedList();
                PressAnyKey();
            }
            break;

            case ConsoleKey.I:
            {
                Console.Clear();
                listRun.ImplementedLinkedList();
                PressAnyKey();
            }
            break;

            case ConsoleKey.D:
            {
                Console.Clear();
                listRun.DuplexLinkedList();
                PressAnyKey();
            }
            break;

            case ConsoleKey.C:
            {
                Console.Clear();
                listRun.CircularLinkedList();
                PressAnyKey();
            }
            break;

            case ConsoleKey.X:
            {
            }
            break;
            }
        }
예제 #2
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;
                }
            }
        }