Example #1
0
        private static void Main(string[] args)
        {
            var tree = GetTreeNode();//todo: fix not creating right number of items

            //todo: rearrange when topics are concluded
            Caller.CallInterfaces();
            Caller.CallKeyValuePair();

            Caller.CallBehavioral();
            Caller.CallCreational();
            Caller.CallStructural();

            //todo: move to caller once written
            var sortingAlgorithms = new List <ISort>
            {
                new BubbleSort(), new SelectionSort(),
                new InsertionSort(), new ShellSort(),
                new QuickSort(), new MergeSort(),
                new Topics.Sorting.TimSort(), new HeapSort(),
                /*new TreeSort(),*/ new BucketSort(),
                new RadixSort(), new CountingSort(),
                new BogoSort(), /*new CubeSort()*/
            };

            foreach (var sortingAlgorithm in sortingAlgorithms)
            {
                sortingAlgorithm.DoSort(GetUnsortedArray());
            }
            //todo: move to caller at some point
            new DepthFirstSearch(GetTreeNode()).DoSearch(8);
            new BreadthFirstSearch(GetTreeNode()).DoSearch(8);
            new LinearSearch().DoSearch(GetUnsortedArray(), 8);
            new BinarySearch().DoSearch(GetUnsortedArray(), 8);
            new ExponentialSearch().DoSearch(GetUnsortedArray(), 8);
            new JumpSearch().DoSearch(GetUnsortedArray(), 8);
            new FibonacciSeearch().DoSearch(GetUnsortedArray(), 8);
            new InterpolationSearch().DoSearch(GetUnsortedArray(), 8);

            new Array().DoIterateOneDimensionArray();
            new Array().DoIterateArrayOfArray();
            new Array().DoIterateTwoDimensionArray();

            new Stack().StackOperations();

            new Queue().QueueOperations();

            Console.WriteLine("---DONE---");
            Console.Read();
        }