Skip to content

Instantly share code, notes, and snippets.

@safern
Last active September 22, 2020 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save safern/5814bf25dacf82596ad4faa3cf53a4e4 to your computer and use it in GitHub Desktop.
Save safern/5814bf25dacf82596ad4faa3cf53a4e4 to your computer and use it in GitHub Desktop.
PriorityQueue api surface
namespace System.Collections.Generic
{
class PriorityQueue<T> : ICollection<T>
{
#region Constructors
public PriorityQueue() { }
public PriorityQueue(IComparer<T> comparer) { }
public PriorityQueue(IEnumerable<T> items) { }
public PriorityQueue(IEnumerable<T> items, IComparer<T> comparer) { }
#endregion
#region ICollection
public void Clear() { }
public bool Contains(T item) { throw null; }
public int Count { get { throw null; } }
public void CopyTo(T[] array, int arrayIndex) { }
public Enumerator GetEnumerator() { throw null; }
void ICollection<T>.Add(T item) { }
bool ICollection<T>.IsReadOnly { get { throw null; } }
IEnumerator IEnumerable.GetEnumerator() { throw null; }
public bool Remove(T item) { throw null; }
#endregion
#region Specific APIs
public IComparer<T> Comparer { get { throw null; } }
public T Dequeue() { throw null; }
public void Enqueue(T item) { }
public T Peek() { throw null; }
public bool TryDequeue(out T item) { throw null; }
public bool TryPeek(out T item) { throw null; }
#endregion
#region Enumerator
public struct Enumerator : IEnumerator<T>, IEnumerator, IDisposable
{
public T Current { get { throw null; } }
object System.Collections.IEnumerator.Current { get { throw null; } }
public void Dispose() { }
public bool MoveNext() { throw null; }
void System.Collections.IEnumerator.Reset() { }
}
#endregion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment