Search Results for

    Show / Hide Table of Contents

    Class PriorityQueue<T>

    A priority queue over a set of IComparable<T> objects.

    Inheritance
    object
    PriorityQueue<T>
    Implements
    IEnumerable<T>
    IEnumerable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Utilities
    Assembly: NetTopologySuite.dll
    Syntax
    public class PriorityQueue<T> : IEnumerable<T>, IEnumerable where T : IComparable<T>
    Type Parameters
    Name Description
    T

    Objects to add

    Constructors

    | Edit this page View Source

    PriorityQueue()

    Creates an instance of this class

    Declaration
    public PriorityQueue()
    | Edit this page View Source

    PriorityQueue(int, IComparer<T>)

    Creates an instance of this class

    Declaration
    public PriorityQueue(int capacity, IComparer<T> comparer)
    Parameters
    Type Name Description
    int capacity

    The capacity of the queue

    IComparer<T> comparer

    The comparer to use for computing priority values

    Properties

    | Edit this page View Source

    Size

    Returns size.

    Declaration
    public int Size { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Add(T)

    Insert into the priority queue. Duplicates are allowed.

    Declaration
    public void Add(T x)
    Parameters
    Type Name Description
    T x

    The item to insert.

    | Edit this page View Source

    Clear()

    Make the priority queue logically empty.

    Declaration
    public void Clear()
    | Edit this page View Source

    GetEnumerator()

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>
    | Edit this page View Source

    IsEmpty()

    Test if the priority queue is logically empty.

    Declaration
    public bool IsEmpty()
    Returns
    Type Description
    bool

    true if empty, false otherwise.

    | Edit this page View Source

    Peek()

    Gets the smallest item without removing it from the queue

    Declaration
    public T Peek()
    Returns
    Type Description
    T
    | Edit this page View Source

    Poll()

    Remove the smallest item from the priority queue.

    Declaration
    public T Poll()
    Returns
    Type Description
    T
    Remarks

    The smallest item, or default(T) if empty.

    Implements

    IEnumerable<T>
    IEnumerable
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX