百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

PHPAlgorithms

> DevOps
开源

这是一组在 PHP 中实现的常用算法,该集合基于 Gayle Laakmann McDowell 的《破解编码面试》(Cracking the Coding Interview) 书中介绍的算法。

945 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

这是一组在 PHP 中实现的常用算法,该集合基于 Gayle Laakmann McDowell 的《破解编码面试》(Cracking the Coding Interview) 书中介绍的算法。

PHP 算法

这是一组在 PHP 中实现的常用算法,该集合基于 Gayle Laakmann McDowell 的《破解编码面试》(Cracking the Coding Interview) 书中描述的算法。 您可以在 Packagist 上找到该包: https://packagist.org/packages/doganoo/php-algorithms

为什么使用 PHPAlgorithms?

"算法 + 数据结构 = 程序" 算法是解决问题的基本工具之一。数据结构以高效的方式组织数据。两者的结合可以创建智能且高效的软件。

安装

您可以通过 composer 安装该包:

bash
composer require doganoo/php-algorithms

使用方法

这里有一个二叉树示例:

php
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);

生产

php
{"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}}}}

献计

欢迎发送 Pull Request 以添加更多算法和数据结构。请在提交 PR 前阅读 https://github.com/doganoo/PHPAlgorithms/wiki/Best-Practices。此外,请考虑 https://github.com/doganoo/PHPAlgorithms/blob/master/CONTRIBUTING.md.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPalgorithmalgorithmscracking-the-coding-interviewdatastructures

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理