Skip to content

AmolKumarGupta/trie-php

Repository files navigation

Trie Implementation

Trie is a tree data structure which is used to store, search and retrieve strings, It is used for autocomplete

Feature

  • Two Type: Trie and Compressed Trie
  • Search existence
  • Autocomplete words

Quick start

use Amol\Trie\CompressedTrie;

$trie = new CompressedTrie();

$trie->add('hello');
$trie->add('apple');

$trie->search('apple'); // true
$trie->autocomplete('app'); // [apple]

Installation

Clone the repository

git clone https://github.com/AmolKumarGupta/trie-php.git
cd trie-php

Install dependencies

composer install

Docker Support

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

For Contributors

Testing and Linting

composer lint && composer test

Benchmarks

composer bench

Releases

No releases published

Languages