HumHub Documentation (unofficial)

TermsPriorityQueue extends AbstractPriorityQueue
in package

Abstract Priority Queue

Tags
category

Zend

subpackage

Index

Table of Contents

Properties

$_heap  : array<string|int, mixed>
Queue heap

Methods

clear()  : void
Clear queue
pop()  : mixed
Removes and return least element of the queue
put()  : void
Add element to the queue
top()  : mixed
Return least element of the queue
_less()  : bool
Compare elements

Properties

$_heap

Queue heap

private array<string|int, mixed> $_heap = 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]

Methods

put()

Add element to the queue

public put(mixed $element) : void

O(log(N)) time

Parameters
$element : mixed

_less()

Compare elements

protected _less(mixed $termsStream1, mixed $termsStream2) : bool

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

Parameters
$termsStream1 : mixed
$termsStream2 : mixed
Return values
bool

        
On this page

Search results