IrisJavaDiary
Tuesday, March 14, 2017
237. Delete Node in a Linked List
public class Solution {
public void deleteNode(ListNode node) {
if (node == null || node.next == null) {
return;
}
node.val = node.next.val;
node.next = node.next.next;
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment