LOG IN
BEGINNER GUIDES
|
PHP CLASSES
|
CODE SEARCH
|
ARTICLES SEARCH
|
PHP FORUMS
|
PHP MANUAL
|
PHP FUNCTIONS LIST
|
WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles
Submit Your Code
SEO Monitor
UpTime Monitor
PHP Code Contest
My Favorite Examples
My Favorite Articles
Update Your Profile
More Weber Sites
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
Recommended Links
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Recommended
Submit Site
Forex Trading
Online forex trading platform
The SplHeap class
SplQueue::setIteratorMode
SplHeap::compare
SPL
PHP Manual
The SplHeap class
Introduction
The SplHeap class provides the main functionalities of an Heap.
Class synopsis
SplHeap
abstract
class
SplHeap
implements
Iterator
,
Countable
{
/* Methods */
__construct
(
void
)
abstract
int
compare
(
mixed
$value1
,
mixed
$value2
)
int
count
(
void
)
mixed
current
(
void
)
mixed
extract
(
void
)
void
insert
(
mixed
$value
)
bool
isEmpty
(
void
)
mixed
key
(
void
)
void
next
(
void
)
void
recoverFromCorruption
(
void
)
void
rewind
(
void
)
mixed
top
(
void
)
bool
valid
(
void
)
}
Table of Contents
SplHeap::compare
— Compare elements in order to place them correctly in the heap while sifting up.
SplHeap::__construct
— Constructs a new empty heap
SplHeap::count
— Counts the number of elements in the heap.
SplHeap::current
— Return current node pointed by the iterator
SplHeap::extract
— Extracts a node from top of the heap and sift up.
SplHeap::insert
— Inserts an element in the heap by sifting it up.
SplHeap::isEmpty
— Checks whether the heap is empty.
SplHeap::key
— Return current node index
SplHeap::next
— Move to the next node
SplHeap::recoverFromCorruption
— Recover from the corrupted state and allow further actions on the heap.
SplHeap::rewind
— Rewind iterator back to the start (no-op)
SplHeap::top
— Peaks at the node from the top of the heap
SplHeap::valid
— Check whether the heap contains more nodes
SplQueue::setIteratorMode
SplHeap::compare
SPL
PHP Manual