mirror of
https://gitee.com/TheAlgorithms/LeetCodeAnimation.git
synced 2024-12-06 15:19:44 +08:00
0024 Solved
This commit is contained in:
parent
32ea760c75
commit
c49a939737
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 9.1 MiB |
BIN
0024-Swap-Nodes-in-Pairs/Animation/Animation1.gif
Normal file
BIN
0024-Swap-Nodes-in-Pairs/Animation/Animation1.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.7 MiB |
BIN
0024-Swap-Nodes-in-Pairs/Animation/Animation2.gif
Normal file
BIN
0024-Swap-Nodes-in-Pairs/Animation/Animation2.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 MiB |
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
### 动画描述
|
### 动画描述
|
||||||
|
|
||||||
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/6kpyu.gif)
|
<img src="../Animation/Animation1.gif" alt="Animation1" style="zoom:150%;" />
|
||||||
|
|
||||||
### 代码实现
|
### 代码实现
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ var swapPairs = function(head) {
|
|||||||
|
|
||||||
### 动画描述
|
### 动画描述
|
||||||
|
|
||||||
|
<img src="../Animation/Animation2.gif" alt="Animation2" style="zoom:150%;" />
|
||||||
|
|
||||||
### 代码实现
|
### 代码实现
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ var swapPairs = function(head) {
|
|||||||
}
|
}
|
||||||
// Nodes to be swapped
|
// Nodes to be swapped
|
||||||
let firstNode = head,
|
let firstNode = head,
|
||||||
secondNode = head.next;
|
secondNode = head.next;
|
||||||
// Swapping
|
// Swapping
|
||||||
firstNode.next = swapPairs(secondNode.next);
|
firstNode.next = swapPairs(secondNode.next);
|
||||||
secondNode.next = firstNode;
|
secondNode.next = firstNode;
|
||||||
|
Loading…
Reference in New Issue
Block a user