验证,校对

This commit is contained in:
jaredliw
2021-07-16 00:06:52 +08:00
parent 4a8c81e88e
commit 88fcd88712
14 changed files with 180 additions and 197 deletions

View File

@@ -4,14 +4,12 @@
>
> 另外希望手机阅读的同学可以来我的 <u>[**公众号袁厨的算法小屋**](https://raw.githubusercontent.com/tan45du/test/master/微信图片_20210320152235.2pthdebvh1c0.png)</u> 两个平台同步,想要和题友一起刷题,互相监督的同学,可以在我的小屋点击<u>[**刷题小队**](https://raw.githubusercontent.com/tan45du/test/master/微信图片_20210320152235.2pthdebvh1c0.png)</u>进入。
今天我们来说一下反转链表 2其实这个和 1 的思路差不多今天先说一个比较好理解的方法完全按照反转链表 1 的方法来解决大家看这个题目之前要先看一下[动画模拟leetcode 206 反转链表](https://github.com/chefyuan/algorithm-base/blob/main/animation-simulation/%E9%93%BE%E8%A1%A8%E7%AF%87/leetcode206%E5%8F%8D%E8%BD%AC%E9%93%BE%E8%A1%A8.md)
今天我们来说一下反转链表 2其实这个和 1 的思路差不多今天先说一个比较好理解的方法完全按照反转链表 1 的方法来解决大家看这个题目之前要先看一下[动画模拟leetcode 206 反转链表](https://github.com/chefyuan/algorithm-base/blob/main/animation-simulation/%E9%93%BE%E8%A1%A8%E7%AF%87/leetcode206%E5%8F%8D%E8%BD%AC%E9%93%BE%E8%A1%A8.md)
下面我们先来看一下题目
#### [92. 反转链表 II](https://leetcode-cn.com/problems/reverse-linked-list-ii/)
难度中等836
给你单链表的头指针 `head` 和两个整数 `left` `right` 其中 `left <= right` 请你反转从位置 `left` 到位置 `right` 的链表节点返回 **反转后的链表**
**示例 1**
@@ -166,7 +164,6 @@ var reverseBetween = function(head, left, right) {
return temp.next;
};
//和反转链表1代码一致
var reverse = function(head) {
let low = null;
@@ -183,7 +180,7 @@ var reverse = function(head) {
Python Code:
```py
```python
class Solution:
def reverseBetween(self, head: ListNode, left: int, right: int) -> ListNode:
# 虚拟头节点