Summary of LinkedList problem-solving methods

Related problems on LeetCode (easy)

2, 21, 82, 83, 86, 141, 160, 203, 206, 234, 237

Medium title

142

Skill

  1. Two pointers, one moves two steps and the other moves one step, so when one reaches the end, the other has reached the middle.
  2. Two pointers can also be used to detect whether there is a cycle.
  3. Never use dummy to create new linked lists.

This websiteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)Please retain the following annotations when sharing or adapting:

Original author:Jake Tao,source:Summary of LinkedList Problem-Solving Methods

222
0 0 222

Further Reading

Post a reply

Log inYou can only comment after that.
Share this page
Back to top