Interface IQueue<T>
Represents a queue (First in, First out).
Namespace: QuikGraph.Collections
Assembly: QuikGraph.dll
Syntax
public interface IQueue<T>
Type Parameters
Name | Description |
---|---|
T | Element type. |
Properties
| Improve this Doc View SourceCount
Number of elements.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceContains(T)
Checks if this queue contains the given value
.
Declaration
bool Contains(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the |
Dequeue()
Dequeues an element from the queue.
Declaration
T Dequeue()
Returns
Type | Description |
---|---|
T | Removed element. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Queue is empty. |
Enqueue(T)
Enqueues an element in the queue.
Declaration
void Enqueue(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value to add. |
Peek()
Returns the element at the beginning of the queue.
Declaration
T Peek()
Returns
Type | Description |
---|---|
T | The top queue element. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Queue is empty. |
ToArray()
Converts this queue to an array.
Declaration
T[] ToArray()
Returns
Type | Description |
---|---|
T[] | Array composed of elements. |