github上最大的开源算法库,可以用于算法的学习和查询,大部分语言都有实现方案,其中python相关达到了165k star。
1 TheAlgorithms/Python简介
所有算法都用python实现的案例展示,常规的算法都可以在这里找到,应该是github上最全的开源算法库了。
什么是算法?
算法是一系列规则,这些规则通过获得一个或者多个输入,在内部进行计算、进行数据处理后,产生一个或者多个输出。简单地说,算法让生活更加美好。从复杂的数据处理、散列,到简单的数学运算,算法遵从一系列步骤来产出一个有用的结果。一个最简单的算法就是一个接受两个输入,把他们相加,然后输出他们的和的函数。
2 如何查看?
github可以访问的直接到如下链接去下载就可以
https://github.com/TheAlgorithms/Python
github如果无法访问的话,可以后台直接私信
算法案例可以直接访问如下链接:
https://the-algorithms.com/zh_Hans
3 部分算法代码展示
排序
Random Normal Distribution Quicksort
数据结构 哈希
密码
Vigenere Cipher
总结
实现仅用于学习目的。它们的效率可能低于 Python 标准库中的实现。可以自行决定使用它们。