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 Zend_Search_Lucene Index Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) New BSD License \Zend_Search_Lucene_PriorityQueue

## Clear queue

`clear() `
Inherited

## Removes and return least element of the queue

`pop() : mixed`
Inherited

O(log(N)) time

`mixed`

## Add element to the queue

`put(mixed \$element) `
Inherited

O(log(N)) time

`mixed`

## Return least element of the queue

`top() : mixed`
Inherited

Constant time

`mixed`

## Compare elements

`_less(mixed \$termsStream1, mixed \$termsStream2) : boolean`

Returns true, if \$termsStream1 is "less" than \$termsStream2; else otherwise

inherited_from \Zend_Search_Lucene_PriorityQueue::_less()

`mixed`

`mixed`

### Returns

`boolean`

## Compare elements

`_less(mixed \$el1, mixed \$el2) : boolean`
Inherited

Returns true, if \$el1 is less than \$el2; else otherwise

`mixed`

`mixed`

### Returns

`boolean`

## Queue heap

`\$_heap : array`

### Default

`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]