承接 doganoo/php-algorithms 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

doganoo/php-algorithms

最新稳定版本:2.1.1

Composer 安装命令:

composer require doganoo/php-algorithms

包简介

A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

README 文档

README

A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

You can find the package on Packagist: https://packagist.org/packages/doganoo/php-algorithms

Why Using PHPAlgorithms?

"Algorithms + Data Structures = Programs"

Algorithms are a part of the basic toolkit for solving problems. Data Structures organize data in an efficient way. The combination of both allow the creation of smart and efficient software.

Installation

You can install the package via composer:

composer require doganoo/php-algorithms

Usage

Here's an Binary Tree example:

use doganoo\PHPAlgorithms\Datastructure\Graph\Tree\BinaryTree;

$binaryTree = new BinaryTree();
$binaryTree->insertValue(50);
$binaryTree->insertValue(25);
$binaryTree->insertValue(75);
$binaryTree->insertValue(10);
$binaryTree->insertValue(100);

echo json_encode($binaryTree);

produces

{"nodes":{"value":50,"left":{"value":25,"left":{"value":10,"left":null,"right":null},"right":null},"right":{"value":75,"left":null,"right":{"value":100,"left":null,"right":null}}}}

Contributions

Feel free to send a pull request to add more algorithms and data structures. Please make sure that you read https://github.com/doganoo/PHPAlgorithms/wiki/Best-Practices before opening a PR. Please also consider https://github.com/doganoo/PHPAlgorithms/blob/master/CONTRIBUTING.md.

Maintainer/Creator

Doğan Uçar (@doganoo)

License

MIT

统计信息

  • 总下载量: 4.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 944
  • 点击次数: 1
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 944
  • Watchers: 37
  • Forks: 91
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-02