2.04 ✅ Linked List

Linked List #

  • Cleverly construct a dummy head node. This can make the traversal and processing logic more uniform.
  • Use recursion flexibly. By constructing recursive conditions, recursion can be used to solve problems cleverly. However, note that recursion cannot be used for some problems, because excessive recursion depth can cause timeouts and stack overflow.
  • Reverse a linked list interval. Problem 92.
  • Find the middle node of a linked list. Problem 876. Find the nth node from the end of a linked list. Problem 19. The answer can be obtained with just one traversal.
  • Merge K sorted linked lists. Problems 21 and 23.
  • Classify linked lists. Problems 86 and 328.
  • Sort a linked list, requiring time complexity O(n * log n) and space complexity O(1). There is only one approach: merge sort, top-down merging. Problem 148.
  • Determine whether a linked list has a cycle; if it has a cycle, output the index of the intersection point of the cycle; determine whether 2 linked lists have an intersection point; if there is an intersection point, output the intersection point. Problems 141, 142, and 160.
No.TitleSolutionDifficultyTimeComplexitySpaceComplexityFavoriteAcceptance
0002Add Two NumbersGoMediumO(n)O(1)40.4%
0019Remove Nth Node From End of ListGoMediumO(n)O(1)41.1%
0021Merge Two Sorted ListsGoEasyO(log n)O(1)62.5%
0023Merge k Sorted ListsGoHardO(log n)O(1)❤️49.8%
0024Swap Nodes in PairsGoMediumO(n)O(1)61.3%
0025Reverse Nodes in k-GroupGoHardO(log n)O(1)❤️54.7%
0061Rotate ListGoMediumO(n)O(1)36.1%
0082Remove Duplicates from Sorted List IIGoMediumO(n)O(1)45.9%
0083Remove Duplicates from Sorted ListGoEasyO(n)O(1)50.6%
0086Partition ListGoMediumO(n)O(1)❤️52.0%
0092Reverse Linked List IIGoMediumO(n)O(1)❤️45.4%
0109Convert Sorted List to Binary Search TreeGoMediumO(log n)O(n)60.2%
0114Flatten Binary Tree to Linked ListGoMedium61.8%
0116Populating Next Right Pointers in Each NodeGoMedium60.4%
0138Copy List with Random PointerGoMedium51.4%
0141Linked List CycleGoEasyO(n)O(1)❤️47.5%
0142Linked List Cycle IIGoMediumO(n)O(1)❤️48.8%
0143Reorder ListGoMediumO(n)O(1)❤️52.6%
0146LRU CacheGoMedium40.7%
0147Insertion Sort ListGoMediumO(n)O(1)❤️51.1%
0148Sort ListGoMediumO(n log n)O(n)❤️55.1%
0160Intersection of Two Linked ListsGoEasyO(n)O(1)❤️54.4%
0203Remove Linked List ElementsGoEasyO(n)O(1)46.0%
0206Reverse Linked ListGoEasyO(n)O(1)73.6%
0234Palindrome Linked ListGoEasyO(n)O(1)50.2%
0237Delete Node in a Linked ListGoMediumO(n)O(1)76.0%
0328Odd Even Linked ListGoMediumO(n)O(1)61.3%
0382Linked List Random NodeGoMedium62.8%
0445Add Two Numbers IIGoMediumO(n)O(n)59.6%
0460LFU CacheGoHard43.0%
0622Design Circular QueueGoMedium51.5%
0705Design HashSetGoEasy65.6%
0706Design HashMapGoEasy64.7%
0707Design Linked ListGoMediumO(n)O(1)27.7%
0725Split Linked List in PartsGoMediumO(n)O(1)57.2%
0817Linked List ComponentsGoMediumO(n)O(1)57.7%
0876Middle of the Linked ListGoEasyO(n)O(1)❤️75.7%
1019Next Greater Node In Linked ListGoMediumO(n)O(1)59.9%
1171Remove Zero Sum Consecutive Nodes from Linked ListGoMedium43.2%
1290Convert Binary Number in a Linked List to IntegerGoEasy82.1%
1669Merge In Between Linked ListsGoMedium73.7%
1670Design Front Middle Back QueueGoMedium57.2%
1721Swapping Nodes in a Linked ListGoMedium67.1%
2181Merge Nodes in Between ZerosGoMedium86.3%

Calendar Jun 28, 2026
Edit Edit this page
Total visits:   You are visitor No.
中文