- Preface
- FAQ
- Guidelines for Contributing
- Contributors
- Part I - Basics
- Basics Data Structure
- String
- Linked List
- Binary Tree
- Huffman Compression
- Queue
- Heap
- Stack
- Set
- Map
- Graph
- Basics Sorting
- 算法复习——排序
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Bucket Sort
- Counting Sort
- Radix Sort
- Basics Algorithm
- Divide and Conquer
- Binary Search
- Math
- Greatest Common Divisor
- Prime
- Knapsack
- Probability
- Shuffle
- Bitmap
- Basics Misc
- Bit Manipulation
- Part II - Coding
- String
- strStr
- Two Strings Are Anagrams
- Compare Strings
- Anagrams
- Longest Common Substring
- Rotate String
- Reverse Words in a String
- Valid Palindrome
- Longest Palindromic Substring
- Space Replacement
- Wildcard Matching
- Length of Last Word
- Count and Say
- Integer Array
- Remove Element
- Zero Sum Subarray
- Subarray Sum K
- Subarray Sum Closest
- Recover Rotated Sorted Array
- Product of Array Exclude Itself
- Partition Array
- First Missing Positive
- 2 Sum
- 3 Sum
- 3 Sum Closest
- Remove Duplicates from Sorted Array
- Remove Duplicates from Sorted Array II
- Merge Sorted Array
- Merge Sorted Array II
- Median
- Partition Array by Odd and Even
- Kth Largest Element
- Binary Search
- Binary Search
- Search Insert Position
- Search for a Range
- First Bad Version
- Search a 2D Matrix
- Search a 2D Matrix II
- Find Peak Element
- Search in Rotated Sorted Array
- Search in Rotated Sorted Array II
- Find Minimum in Rotated Sorted Array
- Find Minimum in Rotated Sorted Array II
- Median of two Sorted Arrays
- Sqrt x
- Wood Cut
- Math and Bit Manipulation
- Single Number
- Single Number II
- Single Number III
- O1 Check Power of 2
- Convert Integer A to Integer B
- Factorial Trailing Zeroes
- Unique Binary Search Trees
- Update Bits
- Fast Power
- Hash Function
- Count 1 in Binary
- Fibonacci
- A plus B Problem
- Print Numbers by Recursion
- Majority Number
- Majority Number II
- Majority Number III
- Digit Counts
- Ugly Number
- Plus One
- Linked List
- Remove Duplicates from Sorted List
- Remove Duplicates from Sorted List II
- Remove Duplicates from Unsorted List
- Partition List
- Add Two Numbers
- Two Lists Sum Advanced
- Remove Nth Node From End of List
- Linked List Cycle
- Linked List Cycle II
- Reverse Linked List
- Reverse Linked List II
- Merge Two Sorted Lists
- Merge k Sorted Lists
- Reorder List
- Copy List with Random Pointer
- Sort List
- Insertion Sort List
- Palindrome Linked List
- Delete Node in the Middle of Singly Linked List
- Rotate List
- Swap Nodes in Pairs
- Remove Linked List Elements
- Binary Tree
- Binary Tree Preorder Traversal
- Binary Tree Inorder Traversal
- Binary Tree Postorder Traversal
- Binary Tree Level Order Traversal
- Binary Tree Level Order Traversal II
- Maximum Depth of Binary Tree
- Balanced Binary Tree
- Binary Tree Maximum Path Sum
- Lowest Common Ancestor
- Invert Binary Tree
- Diameter of a Binary Tree
- Construct Binary Tree from Preorder and Inorder Traversal
- Construct Binary Tree from Inorder and Postorder Traversal
- Subtree
- Binary Tree Zigzag Level Order Traversal
- Binary Tree Serialization
- Binary Search Tree
- Insert Node in a Binary Search Tree
- Validate Binary Search Tree
- Search Range in Binary Search Tree
- Convert Sorted Array to Binary Search Tree
- Convert Sorted List to Binary Search Tree
- Binary Search Tree Iterator
- Exhaustive Search
- Subsets
- Unique Subsets
- Permutations
- Unique Permutations
- Next Permutation
- Previous Permuation
- Permutation Index
- Permutation Index II
- Permutation Sequence
- Unique Binary Search Trees II
- Palindrome Partitioning
- Combinations
- Combination Sum
- Combination Sum II
- Minimum Depth of Binary Tree
- Word Search
- Dynamic Programming
- Triangle
- Backpack
- Backpack II
- Minimum Path Sum
- Unique Paths
- Unique Paths II
- Climbing Stairs
- Jump Game
- Word Break
- Longest Increasing Subsequence
- Follow up
- Palindrome Partitioning II
- Longest Common Subsequence
- Edit Distance
- Jump Game II
- Best Time to Buy and Sell Stock
- Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock III
- Best Time to Buy and Sell Stock IV
- Distinct Subsequences
- Interleaving String
- Maximum Subarray
- Maximum Subarray II
- Longest Increasing Continuous subsequence
- Longest Increasing Continuous subsequence II
- Maximal Square
- Graph
- Find the Connected Component in the Undirected Graph
- Route Between Two Nodes in Graph
- Topological Sorting
- Word Ladder
- Bipartial Graph Part I
- Data Structure
- Implement Queue by Two Stacks
- Min Stack
- Sliding Window Maximum
- Longest Words
- Heapify
- Problem Misc
- Nuts and Bolts Problem
- String to Integer
- Insert Interval
- Merge Intervals
- Minimum Subarray
- Matrix Zigzag Traversal
- Valid Sudoku
- Add Binary
- Reverse Integer
- Gray Code
- Find the Missing Number
- Minimum Window Substring
- Continuous Subarray Sum
- Continuous Subarray Sum II
- Longest Consecutive Sequence
- Part III - Contest
- Google APAC
- APAC 2015 Round B
- Problem A. Password Attacker
- APAC 2016 Round D
- Problem A. Dynamic Grid
- Microsoft
- Microsoft 2015 April
- Problem A. Magic Box
- Problem B. Professor Q's Software
- Problem C. Islands Travel
- Problem D. Recruitment
- Microsoft 2015 April 2
- Problem A. Lucky Substrings
- Problem B. Numeric Keypad
- Problem C. Spring Outing
- Microsoft 2015 September 2
- Problem A. Farthest Point
- Appendix I Interview and Resume
- Interview
- Resume
- 術語表
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Preface
简介
本文档为数据结构和算法学习笔记,我们希望这个笔记能给你在学习算法的过程提供思路和源码方面的参考,但绝不鼓励死记硬背!全文大致分为以下三大部分:
- Part I 为数据结构和算法基础,介绍一些基础的排序/链表/基础算法
- Part II 为 OJ 上的编程题目实战,按题目的内容分章节编写,主要来源为 https://leetcode.com/ , http://www.lintcode.com/ , http://www.geeksforgeeks.org/ , http://hihocoder.com/ , https://www.topcoder.com/ .
- Part III 为附录部分,包含如何写简历和其他附加材料如系统设计
本文参考了很多教材和博客,凡参考过的几乎都给出明确链接,如果不小心忘记了,请不要吝惜你的评论和。
如何练习算法
虽说练习算法偏向于算法本身,但是好的代码风格还是很有必要的。粗略可分为以下几点:
- 代码块可为三大块:异常处理(空串和边界处理),主体,返回
- 代码风格( 可参考 Google 的编程语言规范 )
- 变量名的命名(有意义的变量名)
- 缩进(语句块)
- 空格(运算符两边)
- 代码可读性(即使 if 语句只有一句也要加花括号)
- 《代码大全》中给出的参考
而对于实战算法的过程中,我们可以采取如下策略:
- 总结归类相似题目
- 找出适合同一类题目的模板程序
- 对基础题熟练掌握
以下整理了一些最近练习算法的网站资源,和大家共享之。
在线 OJ 及部分题解
- LeetCode Online Judge - 找工作方面非常出名的一个 OJ,每道题都有 discuss 页面,可以看别人分享的代码和讨论,很有参考价值,相应的题解非常多。
不过在线代码编辑框不太好用,写着写着框就拉下来了,最近没有这个问题了,评测速度通常比 lintcode 快很多,而且做完后可以看自己代码的运行时间分布,首推此 OJ 刷面试相关的题。 - LintCode - 和 leetcode 类似的在线 OJ,但是筛选和写代码时比较方便,左边为题目,右边为代码框。还可以在
source
处选择 CC150 或者其他来源的题。会根据系统 locale 选择中文或者英文,可以拿此 OJ 辅助 leetcode 进行练习。 - hihoCoder - 非常不错的一个 OJ,每周都会推出一个专题供你学习,都是干货。
- LeetCode 题解 - GitBook - 题解部分详细,比较容易理解,但题目很不全。
- FreeTymeKiyan/LeetCode-Sol-Res - Clean, Understandable Solutions and Resources on LeetCode Online Judge Algorithms Problems.
- soulmachine/leetcode - 含 C++和 Java 两个版本的题解。
- Shuatiblog.com - IT,算法及面试。有知识点及类型题总结,特别赞。
- ITint5 | 专注于 IT 面试 - 文章质量很高,也有部分公司面试题评测。
- Acm 之家,专业的 ACM 学习网站 - 各类题解
- 牛客网 - 国内一个 IT 求职方面的综合性网站,比较适合想在国内求职的看看。感谢某位美女的推荐 :)
其他资源
- 九章算法 - 代码质量大多不错,但是不太全。这家也同时提供有偿辅导。
- 刷题 | 一亩三分地论坛 - 时不时就会有惊喜放出。
- VisuAlgo - visualising data structures and algorithms through animation - 相当厉害的数据结构和算法可视化网站。
- Data Structure Visualization - 同上,非常好的动画演示!!涵盖了常用的各种数据结构/排序/算法。
- 我的算法学习之路 - Lucida - Lucida(签约 Google) 的算法学习经验分享。
- HiredInTech - System Design 的总结特别适合入门。
书籍推荐
- 挑战程序设计竞赛(第 2 版) (豆瓣) - ACM 高手总结的各类基础算法和经典问题,含金量非常高!算法进阶力荐!
- Algorithm Design (豆瓣)
- The Algorithm Design Manual , 作者还放出了自己上课的视频和 slides - Skiena's Audio Lectures , The Algorithm Design Manual (豆瓣)
- 大部头有 Introduction to Algorithm 和 TAOCP
- Cracking The Coding Interview - 著名的 CTCI(又称 CC150),除了算法数据结构等题以外,还包含 OO Design, Database, System Design, Brain Teaser 等类型的题目。 准备技术面试的同学一定要看
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论