using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SystemExtensions.Collections { /// /// Implementation of a queue based on a circular array. Efficient implementation when capacity is known from before. /// /// Provided type. class CircularQueue : IQueue { #region Fields int count; int capacity; int insertLocation; int readLocation; T[] items; #endregion #region Properties /// /// Returns the number of items in the queue. /// public int Count { get => count; } /// /// Capacity of the queue. /// public int Capacity { get => capacity; set { } } #endregion #region Constructors public CircularQueue() { count = 0; capacity = 10; items = new T[capacity]; } public CircularQueue(int capacity) { this.capacity = capacity; count = 0; items = new T[capacity]; } #endregion #region Public Methods /// /// Clears the queue. /// public void Clear() { throw new NotImplementedException(); } /// /// Checks if provided item is present into the queue. /// /// Item to be checked. /// True if item is present. False otherwise. public bool Contains(T item) { throw new NotImplementedException(); } /// /// Removes and returns the first item from the queue. /// /// First item from the queue. public T Dequeue() { throw new NotImplementedException(); } /// /// Inserts provided item into the queue. /// /// Item to be inserted. public void Enqueue(T item) { throw new NotImplementedException(); } /// /// Checks and returns the first item from the queue without removing it. /// /// The first item from the queue. public T Peek() { throw new NotImplementedException(); } #endregion #region Private Methods #endregion } }