English | 简体中文
Minimal and clean example implementations of data structures and algorithms in Php 7.2.
Thanks for your interest in contributing! There are many ways to contribute to this project. Get started here
For running all tests write down:
$ phpunit --bootstrap src/autoload.php unit_test
For running some specific tests you can do this as following (Ex: sort):
$ phpunit --bootstrap src/autoload.php unit_test/bitmap/setTest.php
If you want to use the API algorithms in your code, it is as simple as:
$ composer install algorithms_php
You can test by creating a php file: (Ex: use merge_sort
in sort
)
use algorithms_php\sort\merge_sort
$my_list = [1, 8, 3, 5, 6];
$my_list = merge_sort($my_list);
print_r($my_list);
If you want to uninstall algorithms, it is as simple as:
$ composer remove -y algorithms_php
The repo is maintained by