Advertisement
mikymaione

Alg_20170718_1

Jan 18th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. public bool Alg_20170718_1(int x)
  2. {
  3.     var ciclo_da_x = false;
  4.  
  5.     var scc = SCC();
  6.  
  7.     foreach (var c in scc)
  8.         if (c.Count >= x)
  9.         {
  10.             ciclo_da_x = true;
  11.             break;
  12.         }
  13.  
  14.     Console.OutputEncoding = System.Text.Encoding.UTF8;
  15.     Console.WriteLine("Nel grafo {0}, {1}esiste un ciclo di {2} nodi", Nome, (ciclo_da_x ? "" : "Non "), x);
  16.  
  17.     SCC_Print(scc);
  18.  
  19.     return !ciclo_da_x;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement