mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-24 03:56:27 +00:00
Implemented queue interface for standardization.
This commit is contained in:
@@ -11,7 +11,7 @@ namespace SystemExtensions.Collections
|
||||
/// Exposes some of the functionality of the Binary Heap as a queue.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Provided type.</typeparam>
|
||||
public class PriorityQueue<T>
|
||||
public class PriorityQueue<T> : IQueue<T>
|
||||
{
|
||||
#region Fields
|
||||
private BinaryHeap<T> binaryHeap;
|
||||
@@ -77,6 +77,15 @@ namespace SystemExtensions.Collections
|
||||
{
|
||||
binaryHeap.Clear();
|
||||
}
|
||||
/// <summary>
|
||||
/// Checks if queue contains provided item.
|
||||
/// </summary>
|
||||
/// <param name="item">Item to be checked.</param>
|
||||
/// <returns>True if queue contains the provided item. False otherwise.</returns>
|
||||
public bool Contains(T item)
|
||||
{
|
||||
return binaryHeap.Contains(item);
|
||||
}
|
||||
#endregion
|
||||
#region Private Methods
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user