Download the PHP package affinity4/heap without Composer
On this page you can find all versions of the php package affinity4/heap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download affinity4/heap
More information about affinity4/heap
Files in affinity4/heap
Download affinity4/heap
More information about affinity4/heap
Files in affinity4/heap
Vendor affinity4
Package heap
Short Description Full Binary Heap implementation with maxheap, minheap and memory-efficient O(nlogn) and space-complexity of O(1) heapsort algorithm
License MIT
Package heap
Short Description Full Binary Heap implementation with maxheap, minheap and memory-efficient O(nlogn) and space-complexity of O(1) heapsort algorithm
License MIT
Please rate this library. Is it a good library?
Informations about the package heap
Heap Class in PHP
The Heap
class is an implementation of a Max Heap data structure in PHP. A Heap is a complete binary tree where the value of each node is greater than or equal to the values of its children, which makes it useful for efficiently finding the maximum element.
Features
- Heap Construction: Initialize the heap with an array and build a max heap.
- Insert: Add a new element to the heap.
- Remove: Remove a specific element from the heap.
- Sort: Perform heap sort and return the array sorted in ascending or descending order.
Installation
Install the Heap
class via composer:
Usage
Here is an example of how to use the Heap
class:
Tests
Run tests with:
All versions of heap with dependencies
PHP Build Version
Package Version
No informations.
The package affinity4/heap contains the following files
Loading the files please wait ....