TheAlgorithms/C

GitHub: TheAlgorithms/C

C 语言算法集合,涵盖数学、机器学习、计算机科学等领域,专为教学目的设计的参考实现库。

Stars: 21771 | Forks: 4730

# The Algorithms - C # {#mainpage} [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/TheAlgorithms/C) [![CodeQL CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/033b97070a224253.svg)](https://github.com/TheAlgorithms/C/actions/workflows/codeql_analysis.yml) [![Gitter chat](https://img.shields.io/badge/Chat-Gitter-ff69b4.svg?label=Chat&logo=gitter&style=flat-square)](https://gitter.im/TheAlgorithms) [![contributions welcome](https://img.shields.io/static/v1.svg?label=Contributions&message=Welcome&color=0059b3&style=flat-square)](https://github.com/TheAlgorithms/C/blob/master/CONTRIBUTING.md) ![GitHub repo size](https://img.shields.io/github/repo-size/TheAlgorithms/C?color=red&style=flat-square) [![Doxygen CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/04146dfbee224254.svg)](https://TheAlgorithms.github.io/C) [![Awesome CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/93ff991980224255.svg)](https://github.com/TheAlgorithms/C/actions?query=workflow%3A%22Awesome+CI+Workflow%22) [![Income](https://img.shields.io/liberapay/receives/TheAlgorithms.svg?logo=liberapay)](https://liberapay.com/TheAlgorithms) [![Discord chat](https://img.shields.io/discord/808045925556682782.svg?logo=discord&colorB=5865F2)](https://the-algorithms.com/discord/) [![Donate](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/TheAlgorithms/donate) ## 概述 本仓库是使用 C 语言实现的各种算法的开源实现集合,并根据 [GPLv3 License](https://github.com/TheAlgorithms/C/blob/master/LICENSE) 授权。这些算法涵盖了计算机科学、数学和统计学、数据科学、机器学习、工程学等多个领域。这些实现及其相关文档旨在为教育工作者和学生提供学习资源。因此,对于同一目标,可能会发现多种实现,但它们使用了不同的算法策略和优化方法。 ## 特性 * 本仓库提供了各种算法在最基础通用的编程语言之一 —— [C](https://en.wikipedia.org/wiki/C_(programming_language)) 中的实现。 * 文档齐全的源代码和详细的解释为教育工作者和学生提供了宝贵的资源。 * 每个源代码都是原子的,仅使用标准 C 库 [`libc`](https://en.wikipedia.org/wiki/C_standard_library),编译和执行*不需要外部库*。因此,可以更深入地研究算法的基础知识。 * 源代码在每次提交时都会在两大主流操作系统(即 MacOS 和 Ubuntu (Linux))的最新版本上分别使用 AppleClang 14.0.0 和 GNU 11.3.0 进行[编译和测试](https://github.com/TheAlgorithms/C/actions?query=workflow%3A%22Awesome+CI+Workflow%22)。 * 严格遵守 [C11](https://en.wikipedia.org/wiki/C11_(C_standard_revision)) 标准,确保代码只需少量或无需修改即可移植到 ESP32、ARM Cortex 等嵌入式系统。 * 程序内部的自检机制确保了实现的正确性和可靠性。 * 模块化实现和开源许可使得这些函数可以方便地在其他应用程序中使用。 ## 文档 [在线文档](https://TheAlgorithms.github.io/C)直接由仓库源代码生成。文档包含所有资源,包括源代码片段、程序执行细节、程序流程的图示表示以及必要时的外部资源链接。 点击 [Files 菜单](https://TheAlgorithms.github.io/C/files.html) 查看所有已记录代码的文件列表。 [The Algorithms Contributors](https://github.com/TheAlgorithms/C/graphs/contributors) 编写的 [Documentation of Algorithms in C](https://thealgorithms.github.io/C) 根据 [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1) 授权
Creative Commons LicenseCredit must be given to the creatorAdaptations must be shared under the same terms ## 贡献 作为一个由社区开发和维护的仓库,我们欢迎新的、非剽窃的优质贡献。请阅读我们的[贡献指南](https://github.com/TheAlgorithms/C/blob/master/CONTRIBUTING.md)。
标签:Apex, DNS解析, 代码示例, 动态规划, 图算法, 客户端加密, 客户端加密, 工程计算, 开源项目, 排序算法, 搜索算法, 数值计算, 数学, 数据分析, 数据科学, 数据结构, 机器学习, 物理, 算法, 统计学, 编程库, 计算机科学, 资源验证