Ejemplo n.º 1
0
        public void BruteForceFor3x3ShouldGiveCorrectValues()
        {
            var a = new ExhaustiveSearch(3);

            a.RunWithoutDuplicates();
            a.BestScore.Should().Be(180);
            a.WorstScore.Should().Be(126);
        }
        public static void DoTest()
        {
            long[] FactorsOf120 = new long[]
            {
                2, 2, 2, 3, 5
            };

            Assert.AreEqual(FactorsOf120, ExhaustiveSearch.Factor(120));
        }
        static void ExhaustiveSearchTimer()
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            for (int i = 0; i < ITERATION; i++)
            {
                ExhaustiveSearch.Factor(NUMBER);
            }
            stopwatch.Stop();

            Console.WriteLine("ExhaustiveSearch took : {0}ms", stopwatch.ElapsedMilliseconds);
        }