コード例 #1
0
        public void ComparePerf()
        {
            var naiveImplementation = NaiveImplementation.Create(_wordDictionary);
            var precomputed         = PrecomputedImplementation.Create(_wordDictionary);

            RunPerfTest(naiveImplementation, precomputed);
        }
コード例 #2
0
        public static bool TestTransformation(string from, string to)
        {
            var wordList                  = WordList.Create();
            var naiveImplementation       = NaiveImplementation.Create(wordList);
            var precomputedImplementation = PrecomputedImplementation.Create(wordList);

            var naiveResult       = naiveImplementation.HasValidTransformation(from, to);
            var precomputedResult = precomputedImplementation.HasValidTransformation(from, to);

            Assert.AreEqual(naiveResult, precomputedResult);
            return(naiveResult);
        }