API Documentation

Zend/Search/Lucene/PriorityQueue.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Search_Lucene  
Version
$Id: PriorityQueue.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Search_Lucene_PriorityQueue

Package: Zend\Search\Lucene

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

Children
\Zend_Search_Lucene_Index_TermsPriorityQueue
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprivatearray  $_heap= 'array()'

Queue heap

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]

Default valuearray()Details
Type
array

Methods

methodprotected_less( mixed $el1, mixed $el2 ) : boolean
abstract

Compare elements

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

Parameters
Name Type Description
$el1 mixed
$el2 mixed
Returns
Type Description
boolean
methodpublicclear( ) : void

Clear queue

methodpublicpop( ) : mixed

Removes and return least element of the queue

O(log(N)) time

Returns
Type Description
mixed
methodpublicput( mixed $element ) : void

Add element to the queue

O(log(N)) time

Parameters
Name Type Description
$element mixed
methodpublictop( ) : mixed

Return least element of the queue

Constant time

Returns
Type Description
mixed
Documentation was generated by DocBlox 0.15.1.