English translation is in progress... Some articles are still in Chinese, but most are completed. Please star this repo. The full translation will eventually be finished. Enjoy.
These articles go over different kinds of Algorithmic Thinking. All are based on LeetCode problems. They are not only the solution code for the problem, but also WHY the solution works and HOW we can figure it out.
I don't like one-liners. They can be confusing. I like clear, easily understandable code.
The Gitbook has been deployed and will sync with this branch of the repo: https://labuladong.gitbook.io/algo-en/
If you want to clone this repo, please use following command:
git clone --depth 1 --branch english https://github.com/labuladong/fucking-algorithm.git
This command specifies the english
branch and will limit the depth of the clone and get rid of the Git commit history, which can be faster to clone.
-
I. Dynamic Programming
- Dynamic Programming in Details
- Classic DP: Edit Distance
- Classic DP: Super Egg
- Classic DP: Super Egg(Advanced Solution)
- Class DP: Longest Common Subsequence
- Classis DP: Game Problems
- Regular Expression
- The Strategies of Subsequence Problem
- Greedy: Interval Scheduling
- 4 Keys Keyboard
- What is DP Optimal Substructure
- Longest Increasing Subsequence
- KMP Algorithm In Detail
- House Robber Problems
- Stock Buy and Sell Problems
-
II. Data Structures
- Binary Head and Priority Queue
- LRU Cache Strategy in Detail
- Collections of Binary Search Operations
- Special Data Structure: Monotonic Stack
- Special Data Structure: Monotonic Stack
- Design Twitter
- Reverse Part of Linked List via Recursion
- What's the Best Algo Book
- Queue Implement Stack/Stack implement Queue
- Frameworkabout learning data structure and algorithm
-
III. Algorithmic thinking
- My Way to Learn Algorithm
- The Framwork of Backtracking Algorithm
- Binary Search in Detail
- The Tech of Double Pointer
- The Key Concept of TowSum Problems
- Divide Complicated Problem: Implement a Calculator
- Prefix Sum Skill
- FloodFill Algorithm in Detail
- Interval Scheduling: Interval Merging
- Interval Scheduling: Intersections of Intervals
- String Multiplication
- Pancake Sorting Algorithm
- Sliding Window Algorithm
- Some Useful Bit Manipulations
- Russian Doll Envelopes Problem
- Recursion In Detail
- Backtracking Solve Subset/Permutation/Combination
- Several counter-intuitive Probability Problems
- Shuffle Algorithm
-
IV. High Frequency Interview Problems
- How to Implement LRU Cache
- How to Find Prime Number Efficiently
- How to Calculate Minimium Edit Distance
- How to Solve Drop Water Problem
- How to Remove Duplicate From Sorted Sequence
- How to Find Longest Palindromic Substring
- How to Reverse Linked List in K Group
- How to Check the Validation of Parenthesis
- How to Find Missing Element
- How to Pick Elements From a Arbitrary Sequence
- How to use Binary Search
- How to Scheduling Seats
- Union-Find Algorithm in Detail
- Union-Find Application
- Find Sebesquence With Binary Search
- Problems can be sloved by one line
- How to Find Dup and Missing Element
- How to Check Palindrom LinkedList
-
V. Common Knowledge