# Introduction

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 contain **not just the solution code for a problem, but also WHY the solution works and HOW you too 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/](https://labuladong.gitbook.io/algo-en/)

If you would like 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.

## Table of Contents

* 0 . Must Read Series
  * [The Framework for Learning Algorithms and intense problem solving exercises](ii.-data-structure/framework-and-thoughts-about-learning-data-structure-and-algorithm)
  * [Algs4: Recommended book for Learning Algorithms and Data Structures](ii.-data-structure/why_i_recommend_algs4)
  * [An analysis of Dynamic Programming](i.-dynamic-programming/analysisofdynamicprogramming)
  * [Dynamic Programming Q\&A - What is Optimal Substructure](i.-dynamic-programming/optimalsubstructure)
  * [The Framework for Backtracking Algorithm](iii.-algorithmic-thinking/detailsaboutbacktracking)
  * [Binary Search in Detail: I wrote a Poem](iii.-algorithmic-thinking/detailedbinarysearch)
  * [The Sliding Window Technique](iii.-algorithmic-thinking/slidingwindowtechnique)
  * [Difference Between Process and Thread in Linux](v.-common-knowledge/linuxprocess)
  * [Some Good Online Practice Platforms](v.-common-knowledge/onlinepraticeplatform)
* I. Dynamic Programming Series
  * [Dynamic Programming in Details](i.-dynamic-programming/analysisofdynamicprogramming)
  * [Dynamic Programming Q\&A - What is Optimal Substructure](i.-dynamic-programming/optimalsubstructure)
  * [Classic DP: Longest Common Subsequence](i.-dynamic-programming/longestcommonsubsequence)
  * [Classic DP: Edit Distance](broken-reference)
  * [Classic DP: Super Egg](i.-dynamic-programming/throwingeggsinhighbuildings)
  * [Classic DP: Super Egg (Advanced Solution)](i.-dynamic-programming/supereggdropadvanced)
  * [The Strategies of Subsequence Problem](i.-dynamic-programming/strategiesforsubsequenceproblem)
  * [Classic DP: Game Problems](i.-dynamic-programming/gameproblemsindynamicprogramming)
  * [Greedy: Interval Scheduling](i.-dynamic-programming/intervalscheduling)
  * [KMP Algorithm In Detail](i.-dynamic-programming/kmpcharactermatchingalgorithmindynamicprogramming)
  * [A solution to all Buy Time to Buy and Sell Stock Problems](i.-dynamic-programming/besttimetobuyandsellstock)
  * [A solution to all House Robber Problems](i.-dynamic-programming/houserobber)
  * [4 Keys Keyboard](i.-dynamic-programming/fourkeyskeyboard)
  * [Regular Expression](i.-dynamic-programming/regularexpression)
  * [Longest Increasing Subsequence](i.-dynamic-programming/longestincreasingsubsequence)
* II. Data Structures Series
  * [The Framework for Learning Algorithms and intense problem solving exercises](ii.-data-structure/framework-and-thoughts-about-learning-data-structure-and-algorithm)
  * [Algs4: Recommended book for Learning Algorithms and Data Structures](ii.-data-structure/why_i_recommend_algs4)
  * [Binary Heap and Priority Queue](ii.-data-structure/binary_heap_implements_priority_queues)
  * [LRU Cache Strategy in Detail](broken-reference)
  * [Collections of Binary Search Operations](ii.-data-structure/the_manipulation_collection_of_binary_search_tree)
  * [Special Data Structure: Monotonic Stack](ii.-data-structure/monotonicstack)
  * [Special Data Structure: Monotonic Queue](ii.-data-structure/monotonic_queue)
  * [Design Twitter](ii.-data-structure/design_twitter)
  * [Reverse Part of Linked List via Recursion](ii.-data-structure/reverse_part_of_a_linked_list_via_recursion)
  * [Queue Implement Stack/Stack implement Queue](ii.-data-structure/implementqueueusingstacksimplementstackusingqueues)
* III. Algorithmic Thinking Series
  * [My Way to Learn Algorithm](iii.-algorithmic-thinking/thewaytoalgorithmlearning)
  * [The Framework of Backtracking Algorithm](iii.-algorithmic-thinking/detailsaboutbacktracking)
  * [Binary Search in Detail](iii.-algorithmic-thinking/detailedbinarysearch)
  * [Backtracking Solve Subset/Permutation/Combination](iii.-algorithmic-thinking/subset_permutation_combination)
  * [Diving into the technical parts of Double Pointers](iii.-algorithmic-thinking/double_pointer)
  * [Sliding Window Technique](iii.-algorithmic-thinking/slidingwindowtechnique)
  * [The Core Concept of TwoSum Problems](iii.-algorithmic-thinking/the_key_to_resolving_twosum_problems)
  * [Common Bit Manipulations](iii.-algorithmic-thinking/commonbitmanipulation)
  * [Breaking down a Complicated Problem: Implement a Calculator](iii.-algorithmic-thinking/implementing_the_functions_of_a_calculator)
  * [Pancake Sorting Algorithm](iii.-algorithmic-thinking/pancakessorting)
  * [Prefix Sum: Intro and Concept](iii.-algorithmic-thinking/prefix_sum)
  * [String Multiplication](iii.-algorithmic-thinking/string_multiplication)
  * [FloodFill Algorithm in Detail](iii.-algorithmic-thinking/flood_fill)
  * [Interval Scheduling: Interval Merging](iii.-algorithmic-thinking/intervalmerging)
  * [Interval Scheduling: Intersections of Intervals](iii.-algorithmic-thinking/intervalintersection)
  * [Russian Doll Envelopes Problem](iii.-algorithmic-thinking/russiandollenvelopes)
  * [A collection of counter-intuitive Probability Problems](iii.-algorithmic-thinking/several_counter_intuitive_probability_problems)
  * [Shuffle Algorithm](iii.-algorithmic-thinking/shuffle_algorithm)
  * [Recursion In Detail](iii.-algorithmic-thinking/recursionindetail)
* IV. High Frequency Interview Series
  * [How to Implement LRU Cache](broken-reference)
  * [How to Find Prime Number Efficiently](iv.-high-frequency-interview-problem/print_primenumbers)
  * [How to Calculate Minimium Edit Distance](broken-reference)
  * [How to use Binary Search](iv.-high-frequency-interview-problem/usingbinarysearchalgorithm)
  * [How to efficiently solve Trapping Rain Water Problem](iv.-high-frequency-interview-problem/trapping_rain_water)
  * [How to Remove Duplicates From Sorted Array](iv.-high-frequency-interview-problem/removeduplicatesfromsortedarray)
  * [How to Find Longest Palindromic Substring](iv.-high-frequency-interview-problem/thelongestpalindromicsubstring)
  * [How to Reverse Linked List in K Group](iv.-high-frequency-interview-problem/reverse-nodes-in-k-group)
  * [How to Check the Validation of Parenthesis](iv.-high-frequency-interview-problem/valid-parentheses)
  * [How to Find Missing Element](iv.-high-frequency-interview-problem/missing_elements)
  * [How to Find Duplicates and Missing Elements](iv.-high-frequency-interview-problem/find-duplicate-and-missing-element)
  * [How to Check Palindromic LinkedList](iv.-high-frequency-interview-problem/check_palindromic_linkedlist)
  * [How to Pick Elements From an Infinite Arbitrary Sequence](iv.-high-frequency-interview-problem/reservoirsampling)
  * [How to Schedule Seats for Students](iv.-high-frequency-interview-problem/seatscheduling)
  * [Union-Find Algorithm in Detail](iv.-high-frequency-interview-problem/union-find-explanation)
  * [Union-Find Application](iv.-high-frequency-interview-problem/union-find-application)
  * [Problems that can be solved in one line](iv.-high-frequency-interview-problem/one-line-code-puzzles)
  * [Find Subsequence With Binary Search](iv.-high-frequency-interview-problem/findsebesquencewithbinarysearch)
* V. Common Knowledge
  * [Difference Between Process and Thread in Linux](v.-common-knowledge/linuxprocess)
  * [This is the only article you need to understand `session` and `cookie`](v.-common-knowledge/sessionandcookie)
  * [Knowledge about Linux Shell that you should know](v.-common-knowledge/linuxshell)
  * [Cryptology Algorithm](v.-common-knowledge/cryptology)
  * [Git/SQL/Good Online Practice Platforms](v.-common-knowledge/onlinepraticeplatform)
