Ejemplo n.º 1
0
        private static double Analyze(TimeAnalyzer analyzer, object arg, bool refreshNeeded)
        {
            double result = 0;

            for (var i = 0; i < _iterations; i++)
            {
                result += analyzer.Analyze(
                    new object[] { arg },
                    refreshNeeded);
            }

            return(result / _iterations);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //Temp();
            foreach (var count in _counts)
            {
                var bt       = Initializer.InitializeBinarySearchTree(Case.Worst, count);
                var caseItem = int.MaxValue;

                var analyzer = new TimeAnalyzer(
                    new TestingStructure(typeof(BinarySearchTree), bt, "deleteKey"));
                Out(count, Math.Round(Analyze(analyzer, caseItem, true), 10));
            }

            ForegroundColor = ConsoleColor.Green;
            WriteLine("Analyzation ended successfully.");
            ResetColor();
            ReadKey();
        }