一:经常会用到:Dummy Node,返回值是 dummy.next
2. Merge Two Sorted Lists
3. Partition List
Scenario: When the head is not determinated, 即head node 操作以后有可能发生变化
常见题目:
1. Remove Duplicates from Sorted List I, II2. Merge Two Sorted Lists
3. Partition List
4. Reverse Linked List II (Leetcode 上只有ii,没i)
5 Order list (merge的时候需要用到dummy node)
本文详细解析了DummyNode在链表操作中,尤其是处理头节点不确定情况下的重要性,通过实例如去重、合并排序链表等,展示了其在不同场景中的运用,强调了在链表算法实现中的关键作用。
2032

被折叠的 条评论
为什么被折叠?



