The SplMaxHeap class

Introduction

The SplMaxHeap class provides the main functionalities of a heap, keeping the maximum on the top.

Class synopsis

SplMaxHeap
extends SplHeap
/* Methods */
protected int SplMaxHeap::compare(mixed $value1, mixed $value2)
/* Inherited methods */
protected int compare(mixed $value1, mixed $value2)
public int count()
public mixed current()
public mixed extract()
public true insert(mixed $value)
public bool isCorrupted()
public bool isEmpty()
public int key()
public void next()
public bool recoverFromCorruption()
public void rewind()
public mixed top()
public bool valid()
Table of Contents
  • SplMaxHeap::compare — Compare elements in order to place them correctly in the heap while sifting up