diff options
author | Toby Vincent <tobyv13@gmail.com> | 2021-03-28 01:01:30 +0000 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2021-03-28 01:01:30 +0000 |
commit | bf4c7f3d9d7c69976aaa2f7c1b59d5e837d511c1 (patch) | |
tree | a3753e1234e1bc4bb50787f7cc9aaf69d46d2d17 | |
parent | a5c5bf0b5fe32a19a173af31e0199deb7456a74a (diff) |
fixed ToString
-rw-r--r-- | Edge.cs | 2 | ||||
-rw-r--r-- | Vertex.cs | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -18,6 +18,6 @@ namespace Graph public int CompareTo(Edge<T> edge) => Weight.CompareTo(edge.Weight); - public override string ToString() => $"{V} {Weight}"; + public override string ToString() => $"{U} {V} {Weight}"; } } @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using PriorityQueue; using PriorityQueue.Interfaces; @@ -15,6 +16,6 @@ namespace Graph public Vertex(int id, List<Edge<T>> edges) : this(id) => Edges = edges; - public override string ToString() => $"{Id} {String.Join(" ", Edges)}"; + public override string ToString() => $"{Id} {String.Join(" ", Edges.Select(e => (e.V, e.Weight)))}"; } } |