Delete Node in a Linked List 2020-09-21 00:16
public void deleteNode(ListNode node) {
ListNode next = node.next;
node.val = next.val;
node.next = next.next;
}
Runtime | Memory |
---|---|
0 ms | 38.3 MB |
EOF
public void deleteNode(ListNode node) {
ListNode next = node.next;
node.val = next.val;
node.next = next.next;
}
Runtime | Memory |
---|---|
0 ms | 38.3 MB |
EOF