ReturnVfirst() public method

public ReturnVfirst ( ) : Vertex
return Vertex
Ejemplo n.º 1
0
        public static int Main()
        {
            Graph.flag = false;
            exitCode   = 100;

            Console.WriteLine("Test should pass with ExitCode 100");
            Console.WriteLine("Building Graph with 100 vertices...");
            Graph MyGraph = new Graph(100);

            MyGraph.BuildGraph();
            MyGraph.CheckIfReachable();

            Console.WriteLine("Deleting all vertices...");

            MyGraph.DeleteVertex();

            GC.Collect();
            GC.WaitForPendingFinalizers();

            Vertex temp = MyGraph.ReturnVfirst();

            GC.KeepAlive(temp); // will keep alive the graph till here

            Console.WriteLine("Done...");
            Graph.flag = true;  // to check if finalizers ran at shutdown or earlier
            return(exitCode);
        }
  public static void Main()
  {
	Graph.flag=false;
        Environment.ExitCode = 0;

	Console.WriteLine("Test should pass with ExitCode 0");
	Console.WriteLine("Building Graph with 100 vertices...");
	Graph MyGraph = new Graph(100);  

	MyGraph.BuildGraph();    
	MyGraph.CheckIfReachable();

	Console.WriteLine("Deleting all vertices...");

	MyGraph.DeleteVertex();

	GC.Collect();
	GC.WaitForPendingFinalizers();

	Vertex temp = MyGraph.ReturnVfirst();	
	GC.KeepAlive(temp);	// will keep alive the graph till here

	Console.WriteLine("Done...");
	Graph.flag=true;	// to check if finalizers ran at shutdown or earlier
	
  }