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