Exemplo n.º 1
0
        public MinPriorityQueue(int capacity, IMinPriorityQueueNodePool <TKey, TValue> nodePool)
        {
            if (capacity < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(capacity));
            }

            if (nodePool == null)
            {
                nodePool = new DefaultMinPriorityQueueNodePool <TKey, TValue>();
            }

            m_NodePool      = nodePool;
            m_Dict          = new Dictionary <TKey, MinPriorityQueueNode <TKey, TValue> >(capacity);
            m_MinBinaryHeap = new List <MinPriorityQueueNode <TKey, TValue> >(capacity);
        }
Exemplo n.º 2
0
 public MinPriorityQueue(IMinPriorityQueueNodePool <TKey, TValue> nodePool) : this(0, nodePool)
 {
     // Empty.
 }