逆天七劍合璧 發表於 2025-1-10 15:34:00

237.删除链表中的节点

<p>237.删除链表中的节点</p>
<pre><code class="language-js">/**
* Definition for singly-linked list.
* function ListNode(val) {
*   this.val = val;
*   this.next = null;
* }
*/
/**
* @param {ListNode} node
* @return {void} Do not return anything, modify node in-place instead.
*/
var deleteNode = function(node) {
    node.val=node.next.val
    node.next=node.next.next
};
</code></pre><br><br>
来源:https://www.cnblogs.com/KooTeam/p/18664088
頁: [1]
查看完整版本: 237.删除链表中的节点