Abstract Priority Queue
It implements a priority queue. Please go to "Data Structures and Algorithms", Aho, Hopcroft, and Ullman, Addison-Wesley, 1983 (corrected 1987 edition), for implementation details.
It provides O(log(N)) time of put/pop operations, where N is a size of queue
category | Zend |
---|---|
package | Zend_Search_Lucene |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
clear()
pop() : mixed
O(log(N)) time
mixed
put(mixed $element)
O(log(N)) time
mixed
top() : mixed
Constant time
mixed
_less(mixed $el1, mixed $el2) : boolean
Returns true, if $el1 is less than $el2; else otherwise
mixed
mixed
boolean
$_heap : array
array()
Heap contains balanced partial ordered binary tree represented in array [0] - top of the tree [1] - first child of [0] [2] - second child of [0] ... [2n + 1] - first child of [n] [2n + 2] - second child of [n]