PriorityQueue


Object Hierarchy:

Object hierarchy for PriorityQueue

Description:

public class PriorityQueue<T> : Object

A priority queue backed by a binary min-heap.

Elements are ordered according to a comparison function provided at construction time. The element with the smallest value (as determined by the comparator) is always at the head.

Inspired by Java's PriorityQueue and Go's container/heap.

Example:

    var pq = new PriorityQueue<string> ((a, b) => {
return strcmp (a, b);
});
pq.add ("banana");
pq.add ("apple");
pq.add ("cherry");
assert (pq.peek () == "apple");
assert (pq.poll () == "apple");
assert (pq.poll () == "banana");


Namespace: Vala.Collections
Package: Valacore

Content:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object