Introduce

SourceHow can I learn algorithms and data structures from scratch? - Quora

It feels like this site has a foreign flavor of Zhihu

Plan

Day −∞−∞ to 0: Stick to a programming language like C or C++. Make sure that you are comfortable with pointers/objects.

对象和指针理解

Day 1: Understand the concept of Algorithmic complexity. Skip the theory for now, but for every piece of code you write, you should be able to derive both time and space complexity.

时间复杂度和空间复杂度了解,可以估算算法的时间和空间复杂度,理论部分可以跳过

Day 2 - 10: Let’s start with some simple data structures,

  1. Arrays
  2. Linked Lists
  3. Strings
  4. Stacks
  5. Queues

Understand their basic operations (insert, delete, search, traversal) and their complexity - Big-O Algorithm Complexity Cheat Sheet, and code them all.

理解常见线性和非线性数据结构的增删改查的细节。

Day 11 - 25: Let’s now learn some simple algorithms,

  1. Sorting - Insertion sortMerge sortQuick sortHeap sortBucket sortCounting sortRadix sortExternal sorting
  2. Search - Linear searchBinary Search (along with its variants).
  3. Prime Numbers - Sieve of EratosthenesPrimality test
  4. Strings - String searchingLCSPalindrome detection
  5. Miscellaneous - Euclidean algorithmMatrix multiplicationFibonacci NumbersPascal's TriangleMax Subarray problem

归纳:

  • 常见排序算法
  • 搜索算法
  • 素数
  • 字符串查找
  • 杂七杂八算法

Day 26 - 50: Once you are comfortable with everything above, start doing problems from,

  1. Cracking the Coding Interview
  2. Elements of Programming Interviews
  3. Programming Interviews Exposed: Secrets to Landing Your Next Job
  4. GeeksforGeeks
  5. HackerRank
  6. InterviewBit
面试常考算法,然后需要反复练习常见数据结构的相关算法

Stick to chapters of arrays, linked lists, strings, stacks, queues and complexity.

Day 51 - 60: Let’s learn some non-linear data structures,

非线性结构算法学习
  1. Tree
  2. Binary Tree, Binary Search Tree - Tree traversalsLowest common ancestorDepth, Height & DiameterFinding k-th smallest element
  3. Heaps
  4. Hash table - 4 sum problemChecking if sudoku solution is valid
  5. Graph - Breadth-first searchDepth-first searchTopological sortingMinimum spanning treeShortest path problem,
二叉树、二叉树查找
哈希表
垃圾回收算法。

Day 61- 90: Refer to the previous resources and start doing problems from trees, hash tables, heaps and graphs.

参考之前的练习,使用非线性结构的思维模式重做一遍。

Day 91 - 100: Understand Computational complexity theory and NP-completenessKnapsack problemTravelling salesman problemSAT problem and so on.

理解计算机复杂性理论,NP,SAT,TSP、动态规划等。

Day 101 - ∞∞: You are now better than most of the CS undergrads. Keep revising the above topics and start competitive programming! Good luck!

你现在比大多数的CS本科生都要好。继续复习上述题目,并开始竞争性的编程! 祝您好运!

Xander
198 声望51 粉丝