class · System

PriorityQueue<E, P>

public class System.PriorityQueue<E, P> : System.Any

Elements with priorities; Dequeue gives one with the smallest priority (among equals, in no set order).

Tipo
class
Espacio de nombres
System
Ensamblado
System.Core
Acceso
public
Archivo fuente
PriorityQueue.ant

Parámetros de tipo

NombreRestricciones
Ecualquier tipo
PSystem.IComparable<P>

Herencia

Clases base
Any PriorityQueue<E, P>

Constructores

constructor PriorityQueue()
#
constructor PriorityQueue(capacity: i32)
#

Propiedades

property Count: i32
#

read-only

property IsEmpty: bool
#

read-only

property PeekPriority: P
#

read-only

Métodos

method Enqueue(element: E, priority: P) -> void
#
method Dequeue() -> E
#

The element with the smallest priority, taken out.

method Peek() -> E
#

The element with the smallest priority, and that priority (left in).

method EnqueueDequeue(element: E, priority: P) -> E
#

Enqueue then Dequeue, in one step (the new element comes straight back when it is the smallest).

method Clear() -> void
#

Miembros privados e internos (7)

field elements: E[]
#

private

field priorities: P[]
#

private

field count: i32
#

private

method Grow() -> void
#

private

static method Empty() -> void
#

private static

method Up(at: i32, element: E, priority: P) -> void
#

private

Moves the entry at at (element, priority) up past larger parents.

method Down(at: i32, element: E, priority: P) -> void
#

private

Puts (element, priority) at at and moves it down past smaller children.

Miembros heredados (5)

Código fuente

PriorityQueue<E, P> en Larva HIR, descompilado a partir de su Larva HIR.

System.PriorityQueue.hir
// Elements with priorities; Dequeue gives one with the smallest priority (among equals, in no set order).
public class System.PriorityQueue<E, P> : System.Any
{
    field elements: E[]
    field priorities: P[]
    field count: i32
    method Grow() -> void
    static method Empty() -> void
    // Moves the entry at `at` (element, priority) up past larger parents.
    method Up(at: i32, element: E, priority: P) -> void
    // Puts (element, priority) at `at` and moves it down past smaller children.
    method Down(at: i32, element: E, priority: P) -> void
    constructor PriorityQueue()
    constructor PriorityQueue(capacity: i32)
    method Enqueue(element: E, priority: P) -> void
    // The element with the smallest priority, taken out.
    method Dequeue() -> E
    // The element with the smallest priority, and that priority (left in).
    method Peek() -> E
    // Enqueue then Dequeue, in one step (the new element comes straight back when it is the smallest).
    method EnqueueDequeue(element: E, priority: P) -> E
    method Clear() -> void
    property Count: i32
    property IsEmpty: bool
    property PeekPriority: P
}
Esc