2 using System.Collections.Generic;
\r
7 public class VertexHeap
\r
9 public Dictionary<UVertex, ushort> map = new Dictionary<UVertex, ushort>();
\r
10 public List<UVertex> verts = new List<UVertex>();
\r
18 public ushort Add(UVertex v)
\r
22 if(map.TryGetValue(v, out n))
\r
25 n = (ushort)verts.Count;
\r
31 public int Count { get { return verts.Count; } }
\r
32 public ushort this[UVertex index] { get { return map[index]; } }
\r
33 public UVertex this[int index] { get { return verts[index]; } }
\r
36 public class VertexHeap<T>
\r
38 public Dictionary<T, ushort> map = new Dictionary<T, ushort>();
\r
39 public List<T> verts = new List<T>();
\r
47 public ushort Add(T v)
\r
51 if(map.TryGetValue(v, out n))
\r
54 n = (ushort)verts.Count;
\r
60 public int Count { get { return verts.Count; } }
\r
61 public ushort this[T index] { get { return map[index]; } }
\r
62 public T this[int index] { get { return verts[index]; } }
\r