API Documentation

Search/Lucene/PriorityQueue.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
version
$Id: PriorityQueue.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Search_Lucene_PriorityQueue

Description

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.

Zend_Search_Lucene_PriorityQueue

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
Properties
$_heap
Methods
put
top
pop
clear
_less

Description

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

Properties

$_heap

array $_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]

Details

$_heap
array
visibility
private
default
array
final
false
static
false

Methods

_less

_less( mixed $el1, mixed $el2 ) : boolean

Compare elements

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

Arguments
$el1
mixed
$el2
mixed
Output
boolean
Details
visibility
protected
final
false
static
false

clear

clear( ) :

Clear queue

Details
visibility
public
final
false
static
false

pop

pop( ) : mixed

Removes and return least element of the queue

O(log(N)) time

Output
mixed
Details
visibility
public
final
false
static
false

put

put( mixed $element ) :

Add element to the queue

O(log(N)) time

Arguments
$element
mixed
Details
visibility
public
final
false
static
false

top

top( ) : mixed

Return least element of the queue

Constant time

Output
mixed
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.