> For the complete documentation index, see [llms.txt](https://l.naveenmuthusamy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://l.naveenmuthusamy.com/readme.md).

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