コード例 #1
0
        static void Main(string[] args)
        {
            int noOfInserts = 50000;

            PerformTest("List", new ListTester(), noOfInserts);
            PerformTest("Linked List", new LinkedListTester(), noOfInserts);
            PerformTest("Hash Set", new HashSetTester(), noOfInserts);

            Console.WriteLine("Test af Fibonacci");
            Console.WriteLine("Test af Fibonacci rekursivt: " + TimedTester.MeasureRunTime(() =>
                                                                                           { RekursionsTest.Fibonacci(30); }) + " ms.");
            Console.WriteLine("Test af Fibonacci iterativt: " + TimedTester.MeasureRunTime(() =>
                                                                                           { RekursionsTest.FibonacciIterativt(30); }) + " ms.");



            KeepConsoleWindowOpen();
        }
コード例 #2
0
 public long FindRandom(int noOfFinds, int maxValue)
 {
     return(TimedTester.MeasureRunTimeLoop(() => { FindRandomStatement(Generator.Next(maxValue)); }, noOfFinds));
 }
コード例 #3
0
 public long DeleteRandom(int noOfDeletes)
 {
     return(TimedTester.MeasureRunTimeLoop(DeleteRandomStatement, noOfDeletes));
 }
コード例 #4
0
 public long LookupRandom(int noOfLookups)
 {
     return(TimedTester.MeasureRunTimeLoop(LookupRandomStatement, noOfLookups));
 }
コード例 #5
0
 public long InsertFront(int noOfToInserts, int maxValue)
 {
     return(TimedTester.MeasureRunTimeLoop(() => { InsertFrontStatement(Generator.Next(maxValue)); }, noOfToInserts));
 }
コード例 #6
0
 public long InsertFront(int valuesToAdd, int maxValue)
 {
     return(TimedTester.MeasureRunTimeLoop(() => { InsertFrontStatement(Generator.Next(maxValue)); }, valuesToAdd));
 }
コード例 #7
0
 public long AddInitial(int valuesToAdd, int maxValue)
 {
     return(TimedTester.MeasureRunTimeLoop(() => { AddInitialStatement(Generator.Next(maxValue)); }, valuesToAdd));
 }