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.gitcd trie-phpInstall dependencies
composer installTo build or start container
docker compose up -dGet into container then run command like composer test
docker exec -it strfish-php shTo stop container
docker compose downcomposer lint && composer testcomposer bench