A priority queue class based on a pairing heap

(Available since version 1.0)

Introduction

This class provides the main functionalities of a prioritized queue, implemented using a pairing, max-heap.

It provides the same interface as SplPriorityQueue with the extra method, PriorityQueue::update() which allows one to change the priority of a node in the queue.

Class synopsis

SEIDS::Heaps::Pairing::PriorityQueue extends SEIDS::Heaps::PriorityQueue {
/* Inherited constants */
const int EXTR_DATA = 1 ;
const int EXTR_PRIORITY = 2 ;
const int EXTR_BOTH = 3 ;
/* Inherited properties */
protected mixed $DataStructure ;
protected int $flags = PriorityQueue::EXTR_DATA ;
/* Methods */
public __construct ( void )
/* Inherited methods */
public void __clone ( void )
protected int compare ( mixed $priority1 , mixed $priority2 )
public int count ( void )
public mixed current ( void )
public mixed extract ( void )
public bool insert ( mixed $value , mixed $priority )
public bool isEmpty ( void )
public int key ( void )
public void next ( void )
public bool recoverFromCorruption ( void )
public void rewind ( void )
public int setExtractFlags ( int $flags )
public mixed top ( void )
public void update ( mixed $value , mixed $priority )
public bool valid ( void )
protected mixed processExtract ( SEIDS::Heaps::PriorityQueueHeapItem $extract )
}

Table of Contents

To Top