AllAlgorithms/c
GitHub: AllAlgorithms/c
AllAlgorithms 的 C 语言实现版本,涵盖人工智能、密码学、数据结构、排序、搜索、图论等多个领域的经典算法,适合学习和面试准备。
Stars: 1885 | Forks: 612
我们接受所有 Pull Request。[阅读更多](https://github.com/AllAlgorithms/algorithms/issues/40)
## 参见
- [什么是算法](#what-is-an-algorithm)
- [贡献](https://github.com/AllAlgorithms/algorithms/blob/master/.github/contributing.md)
- [行为准则](https://github.com/AllAlgorithms/algorithms/blob/master/.github/code-of-conduct.md)
- [贴纸和 T 恤](https://www.redbubble.com/people/abranhe/works/34285088)
- [Twitter](https://twitter.com/AllAlgorithms)
- [Instagram](https://instagram.com/AllAlgorithms)
- [算法分类](#categories)
- [维护者](#maintainers)
- [许可证](#license)
## 什么是算法?
非正式地说,算法是任何定义明确的计算过程,它将某个值或一组值作为输入,并产生某个值或一组值作为输出。因此,算法是将输入转换为输出的一系列计算步骤。
一个算法应具备三个重要特征才能被认为是有效的:
- **它应该是有限的**:如果你的算法在试图解决它设计要解决的问题时永不终止,那么它是无用的。
- **它应该有明确定义的指令**:算法的每一步都必须精确定义;对于每种情况,指令都应被明确指定。
- **它应该是有效的**:算法应该解决它设计要解决的问题。并且应该可以通过纸笔演算来证明该算法的收敛性。
## 分类
- [人工智能](#artificial-intelligence)
- [回溯](#backtracking)
- [位操作](#bit-manipulation)
- [细胞自动机](#cellular-automaton)
- [密码](#ciphers)
- [计算几何](#computational-geometry)
- [密码学](#cryptography)
- [数据结构](#data-structures)
- [分治](#divide-and-conquer)
- [动态规划](#dynamic-programming)
- [博弈论](#gaming-theory)
- [图](#graphs)
- [贪心算法](#greedy-algorithms)
- [数学](#math)
- [网络](#networking)
- [数值分析](#numerical-analysis)
- [操作系统](#operating-system)
- [随机算法](#randomized-algorithms)
- [搜索](#searches)
- [选择算法](#selections-algorithms)
- [排序](#sorting)
- [字符串](#strings)
- [在线挑战](#online-challenges)
- [其他](#others)
## [人工智能](artificial-intelligence)
- [基于密度的噪声应用空间聚类 (DBSCAN Clustering)](https://allalgorithms.com/docs/dbscan)
- [交互式自组织数据分析技术 yAy! (ISODATA Clustering)](https://allalgorithms.com/docs/isodata)
- [线性回归 (Linear Regression)](https://allalgorithms.com/docs/linear-regression)
- [逻辑回归 (Logistic Regression)](https://allalgorithms.com/docs/logistic-regression)
- [神经风格迁移 (Neutral Style Transfer)](https://allalgorithms.com/docs/neutral-style-transfer)
- [布尔可满足性问题 (SAT)](https://allalgorithms.com/docs/sat)
- [旅行商问题 (TSP)](https://allalgorithms.com/docs/tsp)
- [A* (A Star)](https://allalgorithms.com/docs/a-star)
- [人工神经网络 (Artificial Neutral Network)](https://allalgorithms.com/docs/artificial-neutral-network)
- [卷积神经网络 (Convolutional Neutral Network)](https://allalgorithms.com/docs/convolutional-neutral-network)
- [决策树 (Decision Tree)](https://allalgorithms.com/docs/decision-tree)
- [因子分解机 (Factorization Machines)](https://allalgorithms.com/docs/factorization-machines)
- [高斯混合模型 (Gaussian Mixture Model)](https://allalgorithms.com/docs/gaussian-mixtrue-model)
- [梯度提升树 (Gradient Boosting Trees)](https://allalgorithms.com/docs/gradient-boostring-trees)
- [层次聚类 (Hierachical Clustering)](https://allalgorithms.com/docs/hierachical-clustering)
- [图像处理 (Image Processing)](https://allalgorithms.com/docs/image-processing)
- [K 近邻 (K Nearest Neighbors)](https://allalgorithms.com/docs/k-nearest-neighbors)
- [K 均值 (K Means)](https://allalgorithms.com/docs/k-means)
- [极小化极大算法 (Minimax)](https://allalgorithms.com/docs/minimax)
- [朴素贝叶斯 (Native Bayes)](https://allalgorithms.com/docs/native-bayes)
- [最近序列记忆 (Nearest Sequence Memory)](https://allalgorithms.com/docs/nearest-sequence-memory)
- [神经网络 (Neutral Network)](https://allalgorithms.com/docs/neutral-network)
- [感知机 (Perceptron)](https://allalgorithms.com/docs/perceptron)
- [主成分分析 (Principal Component Analysis)](https://allalgorithms.com/docs/principal-component-analysis)
- [Q 学习 (Q Learing)](https://allalgorithms.com/docs/q-learning)
- [随机森林 (Random Forests)](https://allalgorithms.com/docs/random-forest)
- [受限玻尔兹曼机 (Restricted Boltzman Machine)](https://allalgorithms.com/docs/restricted-boltzman-machine)
## [回溯](backtracking)
- [Algorithm X](backtracking/algorithm-x)
- [纵横字谜 (Crossword Puzzle)](backtracking/crossword-Puzzle)
- [骑士巡逻 (Knight Tour)](backtracking/knight-tour)
- [M 着色问题 (M Coloring Problem)](backtracking/m-coloring-problem)
- [N 皇后 (N Queen)](backtracking/n-queen)
- [迷宫路径数 (Number of ways in Maze)](backtracking/number-of-ways-in-maze)
- [集合划分 (Partitions of set)](backtracking/partitions-of-set)
- [字符串排列 (Permutation of Strings)](backtracking/permutation-of-strings)
- [幂集 (Powerset)](backtracking/powerset)
- [迷宫中的老鼠 (Rat in maze)](backtracking/rat-in-maze)
- [子集和 (Subset Sum)](backtracking/subset-sum)
- [数独求解 (Sudoku Solve)](backtracking/sudoku-solve)
## [位操作](bit-manipulation)
- [位加法 (Addition using bits)](bit-manipulation/adding-using-bits)
- [位除数 (Bit divisor)](bit-manipulation/bit-divisor)
- [字节交换器 (Byte swapper)](bit-manipulation/byte-swapper)
- [数字转二进制 (Convert numbers to binary)](bit-manipulation/convert-numbers-to-binary)
- [计算置位 (Count set bits)](bit-manipulation/count-set-bits)
- [翻转位 (Flip bits)](bit-manipulation/flip-bits)
- [汉明距离 (Hamming distance)](bit-manipulation/hamming-distace)
- [反转位 (Invert bit)](bit-manipulation/invert-bit)
- [孤独整数 (Lonely integer)](bit-manipulation/lonely-integer)
- [幻数 (Magic Number)](bit-manipulation/magic-number)
- [最大异或值 (Maximum XOR Value)](bit-manipulation/maximun-xor-value)
- [2 的幂 (Power of 2)](bit-manipulation/power-of-2)
- [子集生成 (Subset Generation)](bit-manipulation/subset-generation)
- [二进制数求和 (Sum binary numbers)](bit-manipulation/sum-binary-numbers)
- [和等于异或 (Sum equals XOR)](bit-manipulation/sum-equals-xor)
- [唯一出现三次的数 (Thrice unique number)](bit-manipulation/thrice-unique-number)
- [唯一出现两次的数 (Twice unique number)](bit-manipulation/twice-unique-number)
- [异或交换 (XOR Swap)](bit-manipulation/xor-swap)
## [细胞自动机](cellular-automaton)
- [Brian 的大脑 (Brians Brain)](cellular-automaton/brians-brain)
- [康威生命游戏 (Conways Game of life)](cellular-automaton/conways-game-of-life)
- [基本细胞自动机 (Elementary Cellular Automata)](cellular-automaton/elementary-cellular-automata)
- [通用算法 (Generic Algorithm)](cellular-automaton/generic-algorithm)
- [兰顿蚂蚁 (Langtons Ant)](cellular-automaton/langtons-ant)
- [Nobili 细胞自动机 (Nobili Cellular Automata)](cellular-automaton/nobili-cellular-automata)
- [冯·诺依曼细胞自动机 (Von Neoumann Cellular Automata)](cellular-automaton/von-neoumann-cellular-automata)
## [计算几何](computational-geometry)
- [二维直线相交 (2D Line intersection)](computational-geometry/)
- [二维分离轴测试 (2D Separating Axis test)](computational-geometry/)
- [多边形面积 (Area of polygon)](computational-geometry/)
- [三角形面积 (Area of triangle)](computational-geometry/)
- [轴对齐包围盒碰撞 (Axis aligned bounding box collision)](computational-geometry/)
- [Bresenham 直线算法 (Bresenham Line)](computational-geometry/)
- [Chan 算法 (Chans Algorithm)](computational-geometry/)
- [Cohen-Sutherland 直线裁剪 (Cohen Sutherland Lineclip)](computational-geometry/)
- [点间距离 (Distance between points)](computational-geometry/)
- [Graham 扫描 (Graham Scan)](computational-geometry/)
- [半平面交 (Halfplane intersection)](computational-geometry/)
- [Jarvis 行进 (Jarvis March)](computational-geometry/)
- [Quickull](computational-geometry/)
- [球体四面体相交 (Sphere tetrahedron intersection)](computational-geometry/)
- [Sutherland-Hodgman 裁剪 (Sutherland Hodgeman clipping)](computational-geometry/)
## [密码学](cryptography)
- [仿射密码 (Affine Cipher)](cryptography/)
- [Atbash 密码 (Atbash Cipher)](cryptography/)
- [自动密钥密码 (Autokey Cipher)](cryptography/)
- [培根密码 (Baconian Cipher)](cryptography/)
- [凯撒密码 (Caesar Cipher)](cryptography/)
- [列移位密码 (Colummnar Cipher)](cryptography/)
- [维吉尼亚密码 (Vigenere Cipher)](cryptography/)
## [数据结构](data-structures)
- [包 (Bag)](data-structures/bag/)
- [哈希 (Hashes)](data-structures/hashes/)
- [链表 (Linked List)](data-structures/linked-list/)
- [列表 (List)](data-structures/list/)
- [队列 (Queue)](data-structures/queue/)
- [栈 (Stack)](data-structures/stack/)
- [树 (Tree)](data-structures/tree/)
## [分治](divide-and-conquer)
- [Strassen 矩阵运算 (Strassen Matrix Manipulation)](divide-and-conquer/)
- [最近点对 (Closest Pair of Point)](divide-and-conquer/)
- [逆序数 (Inversion Count)](divide-and-conquer/)
- [Karatsuba 乘法 (Karatsuba Multiplication)](divide-and-conquer/)
- [最大连续子序列和 (Maximum Contiguous subsequence sum)](divide-and-conquer/)
- [分治法归并排序 (Merge Sort using divide and conquer)](divide-and-conquer/)
- [分治法快速排序 (Quick Sort using divide and conquer)](divide-and-conquer/)
- [寻找最小最大值的锦标赛方法 (Tournament Method to find min max)](divide-and-conquer/)
- [Warnock 算法 (Warnock Algorithm)](divide-and-conquer/)
- [X 的 Y 次幂 (X Power Y)](divide-and-conquer/)
## [动态规划](dynamic-programming)
- [数组中位数 (Array Median)](dynamic-programming)
- [最优二叉搜索树 (Optima Binary Search Tree)](dynamic-programming)
- [二项式系数 (Binomial Coefficient)](dynamic-programming)
## [博弈论](gaming-theory)
- [Nim 博弈最佳下一步 (Nim Next Best Move Game)](gaming-theory/)
- [Nim 博弈胜负判定 (Nim Win Loss Game)](gaming-theory/)
- [Grundy 数 Kayle 游戏 (Grundy Numbers Kayle Game)](gaming-theory/)
## [图](graphs)
- [二分图检测 (Bipartite Check)](graphs/)
- [邻接表图表示 (Adjacency Lists graphs representation)](graphs/)
- [A* (A Star)](