adrianoferreira / data-structures
A set of data structures implemented in PHP.
dev-master
2020-01-24 18:20 UTC
Requires (Dev)
- phpunit/phpunit: ^8
This package is auto-updated.
Last update: 2024-11-25 06:07:01 UTC
README
A set of data structures implemented in PHP:
- Hash Table
- More soon...
Installation
It's recommended that you use Composer to install this library.
$ composer require adrianoferreira/data-structures:dev-master
Usage
$hashTable = new \AdrianoFerreira\DS\HashTable\Table( 10 ); $hashTable->insert( 'my-key', 'my value' ); $hashTable->insert( 'my-key', 'updated value' ); $hashTable->insert( 'other-key', 'other value' ); $hashTable->insert( 'abc', 'abc value' ); $hashTable->insert( 'cba', 'cba value' ); //Outputs 'updated value' as it replaces the value of buckets with same key echo $hashTable->get('my-key'); //Outputs 'other value' echo $hashTable->get('other-key'); //Outputs 'cba value' echo $hashTable->get('cba');