Beispiel #1
0
 public void removeSused(GrafVertex vertex, GrafVertex sused)
 {
     foreach (GrafVertex v in vertexi)
     {
         if (v == vertex)
         {
             v.Susedi.removeSused(sused);
         }
     }
 }
Beispiel #2
0
 public void removeSused(GrafVertex vertex)
 {
     foreach (GrafVertex v in vertexi)
     {
         if (v == vertex)
         {
             vertexi.Remove(v);
         }
     }
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public void addVertex(GrafVertex vertex)
 {
     vertexi.Add(vertex);
 }
Beispiel #5
0
 public void addSused(GrafVertex vertex)
 {
     vertexi.Add(vertex);
 }