Labuladong Algo Notes
Feature Overview
Rapid Mastery
Plugin Suite
Visualization Panel
Learning Roadmap
Discussion Section
Reading History
Roadmap
Click on nodes to expand related tutorials and problem sets
Algorithm Visualization
Interactive algorithm visualization panels. Every problem solution has a corresponding visualization panel.
Algorithm Execution Flow Visualization The left shows the algorithm code, the right shows the interactive visualization panel to aid understanding.
Data Structure Visualization Includes data structures such as linked lists, arrays, hash tables, binary trees, multi-way trees, binary heaps, etc.
Recursive Algorithm Visualization Visualizes the exhaustive trees of BFS/DFS with the "framework thinking" approach to understand recursion from a tree perspective.
This feature is supported across the website and all related plugins
Algo Visualization Example
Gamified Algorithms
Mini games that require using algorithms to complete tasks or build features—learn while having fun.
华容道游戏
Support for Major Programming Languages
For complex algorithms, code contains lightbulb icons; hover to see an image that assists understanding.
This feature is supported across the website and all related plugins
class Solution {
public ListNode detectCycle(ListNode head) {
ListNode fast, slow;
fast = slow = head;
while (fast != null && fast.next != null) {
fast = fast.next.next;
slow = slow.next;
if (fast == slow) break;
}
// 上面的代码类似 hasCycle 函数
if (fast == null || fast.next == null) {
// fast 遇到空指针说明没有环
return null;
}
// 重新指向头结点
slow = head;
// 快慢指针同步前进,相交点就是环起点
while (slow != fast) {
fast = fast.next;
slow = slow.next;
}
return slow;
}
}
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
ListNode *fast, *slow;
fast = slow = head;
while (fast != nullptr && fast->next != nullptr) {
fast = fast->next->next;
slow = slow->next;
if (fast == slow) break;
}
// 上面的代码类似 hasCycle 函数
if (fast == nullptr || fast->next == nullptr) {
// fast 遇到空指针说明没有环
return nullptr;
}
// 重新指向头结点
slow = head;
// 快慢指针同步前进,相交点就是环起点
while (slow != fast) {
fast = fast->next;
slow = slow->next;
}
return slow;
}
};
class Solution:
def detectCycle(self, head: ListNode):
fast, slow = head, head
while fast and fast.next:
fast = fast.next.next
slow = slow.next
if fast == slow:
break
# 上面的代码类似 hasCycle 函数
if not fast or not fast.next:
# fast 遇到空指针说明没有环
return None
# 重新指向头结点
slow = head
# 快慢指针同步前进,相交点就是环起点
while slow != fast:
fast = fast.next
slow = slow.next
return slow
func detectCycle(head *ListNode) *ListNode {
fast, slow := head, head
for fast != nil && fast.Next != nil {
fast = fast.Next.Next
slow = slow.Next
if fast == slow {
break
}
}
if fast == nil || fast.Next == nil {
return nil
}
slow = head
for slow != fast {
fast = fast.Next
slow = slow.Next
}
return slow
}
var detectCycle = function(head) {
let fast, slow;
fast = slow = head;
while (fast !== null && fast.next !== null) {
fast = fast.next.next;
slow = slow.next;
if (fast == slow) break;
}
// 上面的代码类似 hasCycle 函数
if (fast === null || fast.next === null) {
// fast 遇到空指针说明没有环
return null;
}
// 重新指向头结点
slow = head;
// 快慢指针同步前进,相交点就是环起点
while (slow !== fast) {
fast = fast.next;
slow = slow.next;
}
return slow;
};
Chrome Plugin for LeetCode
LeetCode Web Enhancements Marks problems I’ve covered on the problem list; adds "Solution" and "Analysis" buttons to the problem details page, allowing you to view solution or visit the site for detailed explanations.
Handy Features Code image annotations, support for all major programming languages, and more.
Algorithm Visualization Almost all problem "Solution" pop-ups include animations to help you better understand algorithms.

VSCode Plugin for LeetCode
Similar features to the Chrome plugin, for those who prefer not to solve problems via the website.
Solve Problems in VSCode Supports LeetCode problem-solving and integrates solutions✨ and analyses✨ to facilitate learning.
Handy Features Code image annotations, support for all major programming languages, and configuration of code templates for easy local debugging.
Algorithm Visualization Almost all problem "Solution" pop-ups include animations to help you better understand algorithms.

JetBrains Plugin for LeetCode
Similar features to the Chrome plugin, for those who prefer not to solve problems via the website.
Solve Problems in JetBrains IDE Supports solving LeetCode problems and integrates solutions✨ and analyses✨ for easy learning. Supports the full JetBrains IDE family, including PyCharm, IntelliJ IDEA, and WebStorm.
Handy Features Code image annotations, support for all major programming languages, and configuration of code templates for easy local debugging.
Algorithm Visualization Almost all problem "Solution" pop-ups include animations to help you better understand algorithms.
