Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1.  public static class CLevelOfGraph<V,S>
  2.     {
  3.         public int iCalcLevelOfGraph(CGraph<V,S> pcGraph)
  4.         {
  5.             ArrayList<V> c_list_of_vertices = pcGraph.cGetVertices();
  6.             int i_max_degree = 0;
  7.             for (V v : c_list_of_vertices)
  8.             {
  9.                 int i_act_degree = pcGraph.cGetEdges(v).size();
  10.                 if(i_act_degree > i_max_degree)
  11.                     i_max_degree = i_act_degree;
  12.             } // for (V v : c_list_of_vertices)
  13.             return i_max_degree;
  14.         } // public int iCalcLevelOfGraph(CGraph<V,S>)
  15.     } // public static class LevelOfGraph<V,S>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement