Пример #1
0
 /// <summary>
 /// Sorts all edges maintained in the object based on the given comparison function.
 /// </summary>
 /// <param name="compare"></param>
 public void SortAllEdges(EdgeComparison compare)
 {
     foreach (KeyValuePair <Node, List <Edge> > pair in nodeEdgePairs)
     {
         pair.Value.Sort((e1, e2) => compare(e1, e2));
     }
 }
Пример #2
0
 /// <summary>
 /// Sorts the list of edges for the provided node given a comparison function.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="compare"></param>
 public void SortEdges(Node node, EdgeComparison compare)
 {
     nodeEdgePairs[node].Sort((e1, e2) => compare(e1, e2));
 }