Trie is a tree data structure which is used to store, search and retrieve strings, It is used for autocomplete
- Two Type: Trie and Compressed Trie
- Search existence
- Autocomplete words
use Amol\Trie\CompressedTrie;
$trie = new CompressedTrie();
$trie->add('hello');
$trie->add('apple');
$trie->search('apple'); // true
$trie->autocomplete('app'); // [apple]
Clone the repository
git clone https://github.com/AmolKumarGupta/trie-php.git
cd trie-php
Install dependencies
composer install
To build or start container
docker compose up -d
Get into container then run command like composer test
docker exec -it strfish-php sh
To stop container
docker compose down
composer lint && composer test
composer bench