Skip to content

Commit

Permalink
update leetcode
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobinqt committed Jul 13, 2023
1 parent a505a10 commit fadae21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion book.leetcode/docs/easy/206.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ type ListNode struct {
}

func reverseList(head *ListNode) *ListNode {
// head == null:当第一次输入为 nil 的时候直接返回 nil,不进行递归操作。
// head.next == null:返回链表的最后一个节点
if head == nil || head.Next == nil {
return head
}
Expand Down Expand Up @@ -118,4 +120,8 @@ func main() {

{{< /tab >}}

{{< /tab >}}
{{< /tab >}}

## 参考

+ [反转链表递归(动画演示、手写 Java 代码、详细注释、LeetCode 高频算法题)](https://www.bilibili.com/video/BV1bg4y1s7vS/)

0 comments on commit fadae21

Please sign in to comment.