using System; using System.Collections.Generic; using System.Text; namespace Priority_Queue { /// /// A helper-interface only needed to make writing unit tests a bit easier (hence the 'internal' access modifier) /// internal interface IFixedSizePriorityQueue : IPriorityQueue where TPriority : IComparable { /// /// Resize the queue so it can accept more nodes. All currently enqueued nodes are remain. /// Attempting to decrease the queue size to a size too small to hold the existing nodes results in undefined behavior /// void Resize(int maxNodes); /// /// Returns the maximum number of items that can be enqueued at once in this queue. Once you hit this number (ie. once Count == MaxSize), /// attempting to enqueue another item will cause undefined behavior. /// int MaxSize { get; } /// /// By default, nodes that have been previously added to one queue cannot be added to another queue. /// If you need to do this, please call originalQueue.ResetNode(node) before attempting to add it in the new queue /// void ResetNode(TItem node); } }