# 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/>

If you would like to clone this repo, please use following command:

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