【文件属性】:
文件名称:leetcode不会-delete-node-in-a-linked-list:删除链表中的节点
文件大小:1KB
文件格式:ZIP
更新时间:2021-06-30 03:20:22
系统开源
leetcode
不会删除链表中的节点
编写一个函数来删除单向链表中的节点(尾部除外),只允许访问该节点。
给定链表——head
=
[4,5,1,9]。
Example
1:
Input:
head
=
[4,5,1,9],
node
=
5
Output:
[4,1,9]
Explanation:
You
are
given
the
second
node
with
value
5,
the
linked
list
should
become
4
->
1
->
9
after
calling
your
function.
Example
2:
Input:
head
=
[4,5,1,9],
node
=
1
Output:
[4,5,9]
Explanation:
You
are
given
the
third
node
with
value
1,
the
linked
list
should
become
4
->
5
->
9
after
calling
your
function.
笔记:
链表将至少有两个元素。
所有节点的值都将是唯一的。
给定的节点不会是尾部,它将始终
【文件预览】:
delete-node-in-a-linked-list-master
----README.md(1KB)