Subscribe to this Algo Notes
For Chinese Readers | 中文读者注意!
Note that the English version and Chinese version are two different products.
If you prefer Chinese, please subscribe the Chinese version here.
中文版本和英文版本是两个不同的产品,需要分别购买。
如果你是中文读者,不要购买英文版,请在 这里 购买中文版本。
Purchase Subscription
By subscribing to the 2024 new version of our website, you will gain the following benefits:
Unlock all articles on Labuladong's Algorithm Notes Website for learning, including tutorials marked with
in the directory. Access all "Enhanced Practice" sections in the Labuladong's Algorithm Notes Website directory, identified by the
icon. Unlock complete access to problem-solving strategies, code, and the visualization panel in our accompanying VSCode Plugin, Chrome Plugin, and JetBrains Plugin.
In every article and exercise section, I will guide you step-by-step on how to think, apply algorithm frameworks, ensuring thorough mastery of algorithms. Currently, the site can help you solve over 500 algorithm problems, with continuous updates.
Site Directory Structure
Introduction
Tools: Tools and Algorithm Visualization
Chrome Extension for LeetCode vscode Plugin for LeetCode JetBrains Plugin for LeetCode Algorithm Visualization Introduction Subscribe to this Algo Notes
Study Plans for Beginners and Quick Mastery
Learning Plan for Beginners Learning Plan for Quick Mastery How to Learn Algorithms Efficiently How to Practice Algo Visualization Cheat Sheet
Getting Started: Programming Language Basics
Chapter Introduction C++ Basics Java Basics Golang Basics Python Basics JS Basic to Use the Algo Visualization LeetCode Guide Let's Have Fun with LeetCode
Basics: Data Structures and Sorting
Implement Dynamic Arrays
Implement Single/Double Linked List
Array and LinkedList Variations
Implement Queue and Stack
Implement HashMap
Hash Table Variations
Binary Tree Structure and Traversal
Binary Tree Variations
Graph Theory and Traversals
Implement and Visualize 10 Sorting Algorithms
Chapter Introduction Key Metrics of Sorting Algorithms Explore Selection Sort in Depth Bubble Sort with Stability Insertion Sort with Reverse Thinking Shell Sort - Better than O(N^2) Quick Sort and Binary Tree Preorder Merge Sort and Binary Tree Postorder Heap Sort and Binary Heap Counting Sort: A New Pespective on Sorting Bucket Sort Radix Sort
Updating
Chapter 0. Classic Problem Solving Templates
Chapter Introduction How to Think About Data Structure and Algorithm Two Pointer Techniques for Linked List Problems Two Pointer Techniques for Array Problems Sliding Window Algorithm Code Template Binary Search Algorithm Code Template One Perspective + Two Thinking Patterns to Master Recursion Dynamic Programming Common Patterns and Code Template Backtracking Algorithm Common Patterns and Code Template BFS Algorithm Common Patterns and Code Template Thinking Recursion Algorithms from Binary Tree Perspective Backtracking Algorithm to Solve All Permutation/Combination/Subset Problems Greedy Algorithms Principles and Techniques Divide and Conquer Principles and Techniques Time and Space Complexity Analysis Practical Guide
Chapter 1. Data Structure Algorithms
Linked List
Array
Two Pointer Techniques for Array Problems Tricks to Traverse a 2D Array One Trick to Solve All N-Sum Problems Exercise: Two Pointer Techniques for Array Prefix Sum Array Technique Exercise: Prefix Sum Techniques Difference Array Technique Sliding Window Algorithm Code Template Exercise: Sliding Window In Action Sliding Window Application: Rabin Karp String Matching Algorithm Binary Search Algorithm Code Template Binary Search in Action Exercise: Binary Search Algorithm Weighted Random Selection Algorithm Advantage Shuffle Algorithm
Classic Stack/Queue Algorithm
Implement Stack with Queue, Implement Queue with Stack Exercise: Stack Problems on LeetCode Exercise: Bracket Problems on LeetCode Exercise: Queue Problems on LeetCode Monotonic Stack Code Template Exercise: Monotonic Stack Problems on LeetCode Monotonic Queue to Solve Sliding Window Problems Exercise: Monotonic Queue Implementation and Leetcode Problems
Binary Tree
Thinking Recursion Algorithms from Binary Tree Perspective Binary Tree in Action (Traversal) Binary Tree in Action (Construction) Binary Tree in Action (Post-order) Binary Tree in Action (Serialization) Binary Search Tree in Action (In-order) Binary Search Tree in Action (Basic Operations) Binary Search Tree in Action (Construction) Binary Search Tree in Action (Post-order)
Master Binary Tree Problems
Chapter Introduction Exercise: Binary Tree Traversal I Exercise: Binary Tree Traversal II Exercise: Binary Tree Traversal III Exercise: Binary Tree Divide and Conquer I Exercise: Binary Tree Divide and Conquer II Exercise: Binary Tree Combine Two Views Exercise: Binary Tree Post-order I Exercise: Binary Tree Post-order II Exercise: Binary Tree Post-order III Exercise: Binary Tree Level I Exercise: Binary Tree Level II Exercise: Binary Search Tree I Exercise: Binary Search Tree II
Binary Tree Follow-up
Design Data Structures
Implementing LRU Cache like Building a Lego Implementing LFU Cache like Building a Lego How to Deleting Array Element in O(1) Time Exercise: Hash Table Problems on LeetCode Exercise: Priority Queue Problems on LeetCode Implementing TreeMap/TreeSet Basic Segment Tree Implementation Dynamic Segment Tree Implementation Lazy Update Segment Tree Implementation Exercise: Segment Tree Problems Implementing Trie Tree Exercise: Trie Problems on LeetCode Designing a Twitter Feed Designing an Exam Room Algorithm Exercise: Classic Design Problems on LeetCode How to Implement a Calculator Implementing Median Algorithm with Two Binary Heaps Removing Duplicates from an Array (Hard Version)
Graph
Cycle Detection and Topological Sort Algorithm Searching for a Celebrity How to Determine a Bipartite Graph Union-Find Algorithm Exercise: Union-Find Problems on LeetCode Kruskal Minimum Spanning Tree Algorithm Prim Minimum Spanning Tree Algorithm Dijkstra Algorithm Template and Applications Exercise: Dijkstra Problems
Chapter 2. Brute Force Search
DFS and Backtracking Algorithm
Backtracking Algorithm Common Patterns and Code Template Backtracking in Action: Sudoku and N-Queens Implement Sudoku Cheat Backtracking Algorithm to Solve All Permutation/Combination/Subset Problems Ball and Box: Two Perspectives of Backtracking Enumeration Some Questions About Backtracking and DFS Algorithms Solve All Island Problems with DFS Backtracking Algorithm Practice: Generating Valid Parentheses Backtracking Algorithm Practice: Partitioning k Subsets Exercise: Backtracking Problems on LeetCode I Exercise: Backtracking Problems on LeetCode II Exercise: Backtracking Problems on LeetCode III
BFS Algorithm
Chapter 3. Dynamic Programming Algorithms
Basic DP Techniques
Dynamic Programming Common Patterns and Code Template How to Design Transition Equations How to Determine the Base Case and Initial Values for Memoization? Two Perspectives of Dynamic Programming Enumeration How to Convert Backtracking to Dynamic Programming Optimize Space Complexity for Dynamic Programming Clarifying Some Questions About Dynamic Programming
Subsequence Problems
Knapsack Problems
Dynamic Programming Game
Classic DP: Minimum Path Sum Play Dungeon Game with DP Play Freedom Trail with DP Save Money on Your Trip: Weighted Shortest Path Classic DP: Regular Expression Matching Classic DP: Egg Drop Classic DP: Burst Balloons Classic DP: Game Theory One Method to Solve All House Robber Problems on LeetCode One Method to Solve all Stock Problems on LeetCode
Greedy
Chapter 4. Other Common Techniques
Mathematical Techniques
LeetCode Problems with One Line Solution Common Bit Manipulation Techniques Random Algorithms in Games Two Classic Factorial Problems on LeetCode How to Efficiently Count Prime Numbers How to Efficiently Perform Modular Exponentiation How to Find Missing and Duplicate Elements Interesting Probability Problems Exercises: Math Tricks
Classic Interview Problems
Tips for Algorithmic Exams How to Efficiently Solve the Trapping Rain Water Problem One Article to Solve All Ugly Number Problems on LeetCode One Method to Solve Three Interval Problems on LeetCode Split Array into Consecutive Subsequences Pancake Sorting Algorithm String Multiplication Calculation How to Determine if a Rectangle is Perfect
Appendix
Note
After subscribing, exclusive content on the site will automatically unlock, but the features in the plugins will not unlock automatically and require manual activation.
If you need to use the accompanying practice plugins, detailed operation methods for each plugin are provided below. Please check them out.
The new website subscription is available at a limited-time discount and will be regularly updated, leading to gradual price increases, so it's more cost-effective to purchase early. Upon purchase, you will unlock all website, exercise, plugin, and visualization panel content and features, valid for one year. All at the cost of just one meal; a fair deal, isn't it?
Attention
After subscribing to the site, exclusive content will be automatically unlocked. However, the solutions and problem sets in the plugin will not unlock automatically and require manual operation.
If you need to use the accompanying problem-solving plugin, please manually unlock it according to the instructions in the plugin usage manual.
Unlocking the Chrome Plugin Solutions/Problem Sets
Please refer to the operation steps in Chrome Plugin Usage Documentation under "Unlocking Site Solutions/Problem Sets."
Unlocking the VSCode Plugin Solutions/Problem Sets
Please refer to the operation steps in VSCode Plugin Usage Documentation under "Unlocking Site Solutions/Problem Sets."
Unlocking the JetBrains Plugin Solutions/Problem Sets
Please refer to the operation steps in JetBrains Plugin Usage Documentation under "Unlocking Site Solutions/Problem Sets."