public SimplePriorityQueue()
 {
     _queue = new GenericPriorityQueue <SimpleNode, TPriority>(INITIAL_QUEUE_SIZE);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Instantiate a new Priority Queue
 /// </summary>
 /// <param name="comparer">The comparison function to use to compare TPriority values</param>
 public SimplePriorityQueue(Comparison <TPriority> comparer)
 {
     _queue            = new GenericPriorityQueue <SimpleNode, TPriority>(INITIAL_QUEUE_SIZE, comparer);
     _itemToNodesCache = new Dictionary <TItem, IList <SimpleNode> >();
     _nullNodesCache   = new List <SimpleNode>();
 }
 /// <summary>
 /// Instantiate a new Priority Queue
 /// </summary>
 /// <param name="priorityComparer">The comparison function to use to compare TPriority values</param>
 /// <param name="itemEquality">The equality comparison function to use to compare TItem values</param>
 public SimplePriorityQueue(Comparison <TPriority> priorityComparer, IEqualityComparer <TItem> itemEquality)
 {
     _queue            = new GenericPriorityQueue <SimpleNode, TPriority>(INITIAL_QUEUE_SIZE, priorityComparer);
     _itemToNodesCache = new Dictionary <TItem, IList <SimpleNode> >(itemEquality);
 }