Implemented queue interface for standardization.

This commit is contained in:
JavaOopAlgoStudent
2019-05-23 19:53:26 +02:00
parent 8bd96fa35f
commit d9cd4ad5ea
4 changed files with 155 additions and 1 deletions
+10 -1
View File
@@ -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