1 Star 0 Fork 0

李永鹏/Learn-Algorithms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

#The file is in Chinese

算法虐我千百遍,我待算法如初恋

这里的内容是我学习算法过程的一些记录,希望能一直坚持下去。

学习方法

  • 把所有经典算法写一遍
  • 看算法有关源码
  • 加入算法学习社区,相互鼓励学习(加我vx:tiger-ran, 备注入群理由, 拉你入群)
  • 看经典书籍
  • 刷题

基本数据结构和算法

这些算法全部自己敲一遍:

链表

  • 链表
  • 双向链表

哈希表/散列表 (Hash Table)

  • 散列函数
  • 碰撞解决

字符串算法

  • 排序
  • 查找
    • BF算法
    • KMP算法
    • BM算法
  • 正则表达式
  • 数据压缩

  • 二叉树
  • 二叉查找树
  • 伸展树(splay tree 分裂树)
  • 平衡二叉树AVL
  • 红黑树
  • B树,B+,B*
  • R树
  • Trie树(前缀树)
  • 后缀树
  • 最优二叉树(赫夫曼树)
  • 二叉堆 (大根堆,小根堆)
  • 二项树
  • 二项堆
  • 斐波那契堆(Fibonacci Heap)

图的算法

  • 图的存储结构和基本操作(建立,遍历,删除节点,添加节点)
  • 最小生成树
  • 拓扑排序
  • 关键路径
  • 最短路径: Floyd,Dijkstra,bellman-ford,spfa

排序算法

交换排序算法

  • 冒泡排序
  • 插入排序
  • 选择排序
  • 希尔排序
  • 快排
  • 归并排序
  • 堆排序

线性排序算法

  • 桶排序

查找算法

  • 顺序表查找:顺序查找
  • 有序表查找:二分查找
  • 分块查找: 块内无序,块之间有序;可以先二分查找定位到块,然后再到中顺序查找
  • 动态查找: 二叉排序树,AVL树,B- ,B+ (这里之所以叫 动态查找表,是因为表结构是查找的过程中动态生成的)
  • 哈希表: O(1)

15个经典基础算法

  • Hash
  • 快速排序
  • 快递选择SELECT
  • BFS/DFS (广度/深度优先遍历)
  • 红黑树 (一种自平衡的二叉查找树
  • KMP 字符串匹配算法
  • DP (动态规划 dynamic programming)
  • A*寻路算法: 求解最短路径
  • Dijkstra:最短路径算法 (八卦下:Dijkstra是荷兰的计算机科学家,提出”信号量和PV原语“,"解决哲学家就餐问题",”死锁“也是它提出来的)
  • 遗传算法
  • 启发式搜索
  • 图像特征提取之SIFT算法
  • 傅立叶变换
  • SPFA(shortest path faster algorithm) 单元最短路径算法

海量数据处理

  • Hash映射/分而治之
  • Bitmap
  • Bloom filter(布隆过滤器)
  • Trie树
  • 数据库索引
  • 倒排索引(Inverted Index)
  • 双层桶划分
  • 外排序
  • simhash算法
  • 分布处理之Mapreduce

算法设计思想

  • 迭代法
  • 穷举搜索法
  • 递推法
  • 动态规划
  • 贪心算法
  • 回溯
  • 分治算法

算法题目选编

这是一个算法题目合集,题目是我从网络和书籍之中整理而来,部分题目已经做了思路整理。问题分类包括:

  • 字符串
  • 堆和栈
  • 链表
  • 数值问题
  • 数组和数列问题
  • 矩阵问题
  • 二叉树
  • 海量数据处理
  • 智力思维训练
  • 系统设计

还有部分来自算法网站和书籍:

  • 九度OJ
  • leetcode
  • 剑指offer

开源项目中的算法

  • YYCache
  • cocos2d-objc
  • ...

推荐阅读

刷题必备

  • 《剑指offer》
  • 《编程之美》
  • 《编程之法:面试和算法心得》
  • 《算法谜题》 都是思维题

基础

  • 《编程珠玑》Programming Pearls
  • 《编程珠玑(续)》
  • 《数据结构与算法分析》
  • 《Algorithms》 这本近千页的书只有6章,其中四章分别是排序,查找,图,字符串,足见介绍细致

算法设计

  • 《算法设计与分析基础》
  • 《算法引论》 告诉你如何创造算法 断货
  • 《Algorithm Design Manual》算法设计手册 红皮书
  • 《算法导论》 是一本对算法介绍比较全面的经典书籍
  • 《Algorithms on Strings,Trees and Sequences》
  • 《Advanced Data Structures》 各种诡异高级的数据结构和算法 如元胞自动机、斐波纳契堆、线段树 600块

延伸阅读

  • 《深入理解计算机系统》
  • 《TCP/IP详解三卷》
  • 《UNIX网络编程二卷》
  • 《UNIX环境高级编程:第2版》
  • 《The practice of programming》 Brian Kernighan和Rob Pike
  • 《writing efficient programs》 优化
  • 《The science of programming》 证明代码段的正确性 800块一本

参考链接和学习网站

July 博客

基本算法演示

http://sjjg.js.zwu.edu.cn/SFXX/sf1/sfys.html
http://www.cs.usfca.edu/~galles/visualization/Algorithms.html

编程网站

其它

高级数据结构和算法 北大教授张铭老师在coursera上的课程。完成这门课之时,你将掌握多维数组、广义表、Trie树、AVL树、伸展树等高级数据结构,并结合内排序、外排序、检索、索引有关的算法,高效地解决现实生活中一些比较复杂的应用问题。当然coursera上也还有很多其它算法方面的视频课程。

算法设计与分析 Design and Analysis of Algorithms 由北大教授Wanling Qu在coursera讲授的一门算法课程。首先介绍一些与算法有关的基础知识,然后阐述经典的算法设计思想和分析技术,主要涉及的算法设计技术是:分治策略、动态规划、贪心法、回溯与分支限界等。每个视频都配有相应的讲义(pdf文件)以便阅读和复习。

OI Wiki 主要内容是 OI / ACM-ICPC 相关的知识整理。

联系

@移动开发小冉

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

算法学习笔记 展开 收起
README
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dknuth/Learn-Algorithms.git
git@gitee.com:dknuth/Learn-Algorithms.git
dknuth
Learn-Algorithms
Learn-Algorithms
master

搜索帮助