2017 © Pedro Peláez
 

library phptrie

PHP Trie implementation

image

fran6co/phptrie

PHP Trie implementation

  • Thursday, September 17, 2015
  • by fran6co
  • Repository
  • 2 Watchers
  • 25 Stars
  • 76 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 1 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

PHPTrie

A PHP implementation of a Trie, which is a data structure mainly used for fast string keys searches., (*1)

How to use PHPTrie

Creating a new PHPTrie structure

<?php
use PHPTrie\Trie;
$trie = new Trie();
?>

This creates an empty Trie., (*2)

Inserting elements

You can add entries to the PHPTrie by specifying a key and a value., (*3)

$trie = new Trie();
$trie->add("key", 10);

or, (*4)

$trie = new Trie();
$trie->add("This can be any string!", $myArray);

or, (*5)

$trie = new Trie();
$trie->add("Make sure it's a string...", $stdClassObject);

Your values should probably have a consistent type throughout the whole trie, but exactly how you structure your values is up to you., (*6)

From here on, we will assume that the PHPTrie object has been constructed and is called $trie., (*7)

Overwrite values, (*8)

By default the add method overwrites the values if already exists, if you want to avoid that you can use, (*9)

$trie->add("blah", 11, false);

The Versions

17/09 2015

dev-master

9999999-dev https://github.com/fran6co/phptrie

PHP Trie implementation

  Sources   Download

BSD

The Requires

  • php >=5.3.1

 

by Francisco Facioni

search data structure trie

02/04 2014

v1.1

1.1.0.0 https://github.com/fran6co/phptrie

PHP Trie implementation

  Sources   Download

BSD

The Requires

  • php >=5.3.1

 

by Francisco Facioni

search data structure trie

24/05 2013

v1.0

1.0.0.0 https://github.com/fran6co/phptrie

PHP Trie implementation

  Sources   Download

BSD

The Requires

  • php >=5.3.1

 

by Francisco Facioni

search data structure trie