Was this page helpful?

PriorityQueue<T> Class

    Table of contents
    1. 1. Generic Parameters
      1. 1.1. Parameter T
    2. 2. Members
      1. 2.1. Constructors
      2. 2.2. Fields
      3. 2.3. Properties
      4. 2.4. Methods
    Table of Contents
    public class PriorityQueue<T>
    Namespace: System.Collections.Generic
    Assembly: mindtouch.dream
    Type Hierarchy:
    • object
      • PriorityQueue<T>
    Provides a queue that determines the dequeue order of items by priority.

    Generic Parameters

    Parameter T

    Type of item in the queue.
    Constraints:
    none

    Members

    Constructors

    Visibility Description
    Public PriorityQueue(PriorityQueueComparer<T> comparer) Create a new queue instance.
    Public PriorityQueue(int capacity, PriorityQueueComparer<T> comparer) Create a new queue instance.

    Fields

    Visibility Description
    Protected _list Internal storage of queue items.
    Protected _comparer Comparison delegate for doing queue priority ordering.

    Properties

    Visibility Description
    Public Count Number of items in the queue.
    Public IsEmpty True if there are no items in the queue.

    Methods

    Visibility Description
    Public Enqueue(T item) Add an item to queue.
    Public Dequeue() Get the next item from the queue.
    Public Peek() Get the next item in the queue without removing it.
    Public Remove(T item) Remove an item from the queue.
    Public Clear() Clear all items from the queue.
    Protected SwitchElements(int i, int j) Switch the position of two index positions in the queue.
    Protected RebalanceBinaryArrayStartingAt(int i) Rebalance the queue starting at a specific index into PriorityQueue<T>._list.
    Public ToString() (Inherited from Object)
    Public Equals(object obj) (Inherited from Object)
    Public GetHashCode() (Inherited from Object)
    Public GetType() (Inherited from Object)
    Protected MemberwiseClone() (Inherited from Object)
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by