Beispiel #1
0
    static void Main(string[] args)
    {
        longestPathFinder p = new longestPathFinder();

        node[] nodes   = p.ReadPlaces("agraph");
        bool[] visited = new bool[nodes.Length];
        System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
        timer.Start();
        int result = p.getLongestPath(nodes, 0, visited);

        timer.Stop();
        Console.WriteLine("{0} LANGUAGE CSharp {1} ms", result, Math.Round(timer.Elapsed.TotalMilliseconds));
    }
Beispiel #2
0
    public static void Main(string[] args)
    {
        int numNodes            = 0;
        longestPathFinder p     = new longestPathFinder();
        List <node>       nodes = p.readPlaces(out numNodes);

        bool[] visited = new bool[numNodes];
        for (int i = 0; i < numNodes; i++)
        {
            visited[i] = false;
        }
        long start    = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
        int  result   = p.getLongestPath(nodes, 0, visited);
        long duration = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond - start;

        System.Console.WriteLine(result + " LANGUAGE CSharp " + duration);
    }
Beispiel #3
0
  static void Main(string[] args)
  {



    longestPathFinder p = new longestPathFinder();
    node[] nodes = p.ReadPlaces("agraph");
    bool[] visited = new bool[nodes.Length];
    System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
    timer.Start();
    int result = p.getLongestPath(nodes, 0, visited);
    timer.Stop();
    Console.WriteLine("{0} LANGUAGE CSharp {1} ms", result, Math.Round(timer.Elapsed.TotalMilliseconds));
  }