示例#1
0
文件: Graf.cs 项目: dusansimic/ntp
 public void removeSused(GrafVertex vertex, GrafVertex sused)
 {
     foreach (GrafVertex v in vertexi)
     {
         if (v == vertex)
         {
             v.Susedi.removeSused(sused);
         }
     }
 }
示例#2
0
文件: Graf.cs 项目: dusansimic/ntp
 public void removeSused(GrafVertex vertex)
 {
     foreach (GrafVertex v in vertexi)
     {
         if (v == vertex)
         {
             vertexi.Remove(v);
         }
     }
 }
示例#3
0
文件: Program.cs 项目: dusansimic/ntp
        static void Main(string[] args)
        {
            Graf       g     = new Graf();
            GrafVertex dusan = new GrafVertex("dusan", 0);
            GrafVertex nenad = new GrafVertex("nenad", 1);
            GrafVertex dunja = new GrafVertex("dunja", 2);

            g.addVertex(dusan);
            g.addVertex(nenad);
            g.addVertex(dunja);
            g.addSused(dusan, nenad);
            g.addSused(dusan, dunja);
            g.addSused(dunja, dusan);
            System.Console.WriteLine(g);
        }
示例#4
0
文件: Graf.cs 项目: dusansimic/ntp
 public void addVertex(GrafVertex vertex)
 {
     vertexi.Add(vertex);
 }
示例#5
0
文件: Graf.cs 项目: dusansimic/ntp
 public void addSused(GrafVertex vertex)
 {
     vertexi.Add(vertex);
 }