Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f6f1624

Browse files
authoredJul 14, 2020
Create Readme.md
1 parent e9ea64c commit f6f1624

File tree

1 file changed

+7
-0
lines changed
  • Linked_List/1474.Delete-N-Nodes-After-M-Nodes-of-a-Linked-List

1 file changed

+7
-0
lines changed
 
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### 1474.Delete-N-Nodes-After-M-Nodes-of-a-Linked-List
2+
3+
这道题对于链表的操作考察得比较细致。大致的思路是:
4+
1. 设置p指针为head
5+
2. p指针尝试走m-1格,到达保留区的最后一个位置。如果走不到那里,就终止整个程序。
6+
3. 设置q指针为p,然后尝试走n格,到达删除区的最后一个位置。如果走到了,```p->next = q->next```;否则 ```p->next = NULL```,终止整个程序。
7+
4. 设置```p = p->next```,重复2的循环。

0 commit comments

Comments
 (0)
Please sign in to comment.