The SplMinHeap class

Introduction

The SplMinHeap class provides the main functionalities of a heap, keeping the minimum on the top.

Class synopsis

SplMinHeap
extends SplHeap
/* Methods */
protected int SplMinHeap::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 true recoverFromCorruption()
public void rewind()
public mixed top()
public bool valid()
Table of Contents
  • SplMinHeap::compare — Compare elements in order to place them correctly in the heap while sifting up