{"id":18837179,"url":"https://github.com/zhucola/the-algorithms-php","last_synced_at":"2025-10-12T19:12:12.421Z","repository":{"id":144335564,"uuid":"163286778","full_name":"Zhucola/The-Algorithms-PHP","owner":"Zhucola","description":"PHP也可以写数据结构和算法","archived":false,"fork":false,"pushed_at":"2019-09-28T14:56:24.000Z","size":100,"stargazers_count":42,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T20:11:10.559Z","etag":null,"topics":["algorithm","java-8","leetcode","php7","sort","structure"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zhucola.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-27T11:30:44.000Z","updated_at":"2023-09-22T03:26:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"4991a1a5-c147-4f7a-915d-1bd0c6d6f8f6","html_url":"https://github.com/Zhucola/The-Algorithms-PHP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhucola%2FThe-Algorithms-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhucola%2FThe-Algorithms-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhucola%2FThe-Algorithms-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhucola%2FThe-Algorithms-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zhucola","download_url":"https://codeload.github.com/Zhucola/The-Algorithms-PHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830905,"owners_count":21168369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","java-8","leetcode","php7","sort","structure"],"created_at":"2024-11-08T02:34:18.355Z","updated_at":"2025-10-12T19:12:07.372Z","avatar_url":"https://github.com/Zhucola.png","language":"PHP","readme":"## 排序\n* [冒泡排序]\n* [选择排序]\n* [插入排序]\n* [归并排序]\n* [快速排序]\n* [堆排序]\n\n||冒泡|优化冒泡|选择|优化选择|插入|归并|快排|堆排序|\n|:---|:---|:---|:---|:---|:---|:---|:---|:---|\n|100|0.00023|0.000277|0.000098|0.000082|0.000104|0.000192|0.00014|0.00019|\n|1000|0.02423|0.02597|0.01434|0.0127|0.01208|0.0026|0.0006|0.00308|\n|10000|2.3718|2.3178|1.0359|0.8146|0.8587|0.0222|0.01236|0.03449|\n|50000|61.638|59.470|25.337|20.426|21.491|0.1248|0.09279|0.22093|\n|100000|244.389|236.38|101.58|81.64|86.95|0.267|0.3982|0.4647|\n\n|topK找最大前100个|堆排序|\n|:---|:---|\n|100000|0.0327|\n\n## 查找\n* [二分查找]\n* [二叉树查找]\n## 数据结构\n* [单向链表]\n  * 向链表头添加元素\n  * 向链表尾部添加新节点\n  * 删除链表头元素\n  * 判断链表是否为空\n  * 遍历链表\n  * 向链表中的指定位置插入元素\n  * 删除链表中的指定位置\n  * 不知道节点总个数,找到单链表中间节点\n  * 找到环的入口\n  * 求环的长度\n  * 判断是否有环\n  * 删除排序链表中的重复元素\n  * 在两个链表无环的情况环判断是否相交\n  * 在两个链表有环的情况环判断是否相交\n  * 找到两个有交点的链表的交点\n  * 链表翻转\n  * 在不知道链表长度的情况下，查出倒数第N个节点\n  * 合并两个有序的单链表\n  * 删除一个给定的节点，该节点在链表中，时间复杂度O(1)\n* [双向链表]\n* [二叉堆]\n* [搜索二叉树]\n  * 添加值\n  * 获取key对应的值\n  * 获取最小key对应的值\n  * 翻转\n  * 合并两个二叉树\n  * 查找排名为第N个的键的值\n  * 求高度\n  * 遍历(前、中、后序)\n  * 删除最小键\n  * 删除一个给定的key对应的节点\n  * 判断是否是完全二叉树\n  * 判断是否是满二叉树\n* [虚拟节点一致性hash]\n* [hash表]\n  * 不解决冲突\n  * 拉链法解决冲突\n  * 线性探测法解决冲突\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhucola%2Fthe-algorithms-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhucola%2Fthe-algorithms-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhucola%2Fthe-algorithms-php/lists"}