Esempio n. 1
0
 public void StartTest()
 {
     Console.WriteLine("Test with " + count + " elements: ");
     Console.WriteLine();
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("***Insert*** " + count + " elements test: " + InsertTimeTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("***Search*** test: " + SearchTimeTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("Vertexs count after insert(using List):  " + VertexListTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("Vertexs count after insert(using Count):  " + VertexCountTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("Root color(passed if root is black):  " +
                       (tree.GetRootColorTest() == "black" ? "passed" : "failer"));
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("Descendants are black when parent is red test:  " + NodesColorTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("Tree height test(h(root) <= 2log(N + 1)):  " + HeightTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("***Delete*** " + count / 2 + " elements test: " + DeleteTimeTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine();
     Console.WriteLine("Root color(passed if root is black):  " +
                       (tree.GetRootColorTest() == "black" ? "passed" : "failer"));
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("Descendants are black when parent is red test:  " + NodesColorTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine("Tree height test(h(root) <= 2log(N + 1)):  " + HeightTest());
     Console.WriteLine("-----------------------------------------------------------");
     Console.WriteLine();
 }