Heap::value

(Available since version 1.0)

Heap::valueReturns the true value of a node

Description

protected mixed Heap::value ( mixed $value )

Takes a node and extracts its 'value' as opposed to its priority within the heap.

In this implementation, this method returns its argument unaltered. But it can be overloaded in child classes to produce an updatable heap suitable for use by a priority queue.

This method is called by Heap::hashtIndex() allowing one to update a node's priority without knowing its current priority.

Parameters

value

The node.

Return Values

The 'value' of the node.

To Top