Giter Site home page Giter Site logo

chdemko / php-sorted-collections Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 1.0 411 KB

Sorted Collections for PHP

Home Page: http://php-sorted-collections.readthedocs.io/

License: BSD 3-Clause "New" or "Revised" License

PHP 99.89% TeX 0.11%
collection set tree map sorted ordered iterator treeset treemap avl

php-sorted-collections's Introduction

PHP Sorted Collections

PHP package Coveralls Scrutinizer Code Climate CodeFactor Codacy PHP versions Latest Stable Version Downloads Latest Unstable Version License Last commit Documentation Status Repo Size Code Size

Sorted Collection for PHP. Insertion, search, and removal compute in log(n) time where n is the number of items present in the collection. It uses AVL threaded tree [see @Knuth97, 1:320, Sect. 2.3.1] as internal structure.

@Knuth97: Donald E. Knuth, The Art of Computer Programming, Addison-Wesley, volumes 1 and 2, 2nd edition, 1997.

This project uses:

## Instructions

Using composer: either

$ composer create-project chdemko/sorted-collections:1.0.*@dev; cd sorted-collections
Creating a "chdemko/sorted-collections:1.0.*@dev" project at "./sorted-collections"
...

or create a composer.json file containing

{
    "require": {
        "chdemko/sorted-collections": "1.0.*@dev"
    }
}

and run

$ composer install
Loading composer repositories with package information
...

Create a test.php file containg

<?php

require __DIR__ . '/vendor/autoload.php';

use chdemko\SortedCollection\TreeMap;

$tree = TreeMap::create()->put(
    [1=>1, 9=>9, 5=>5, 2=>2, 6=>6, 3=>3, 0=>0, 8=>8, 7=>7, 4=>4]
);
echo $tree . PHP_EOL;

And run

$ php test.php
[0,1,2,3,4,5,6,7,8,9]

See the examples and benchmarks folders for more information.

Documentation

Run

$ sudo apt install doxygen python3-pip python3-virtualenv
$ virtualenv venv
$ venv/bin/activate
(venv) $ pip install -r docs/requirements.txt
(venv) $ sphinx-build -b html docs/ html/
(venv) $ deactivate
$

if you want to create local documentation with Sphinx.

Citation

If you are using this project including publication in research activities, you have to cite it using (BibTeX format). You are also pleased to send me an email to [email protected].

All releases can be found here

php-sorted-collections's People

Contributors

chdemko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

erdincay

php-sorted-collections's Issues

Consider a Licensing Change

Would you be open to consider a licensing change to something like MIT, or Apache2? I'm not familar with the current license you are using, but one of the two above seem more widely used for OSS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.