Skip to content

Instantly share code, notes, and snippets.

@janehwzn
Created August 26, 2015 05:43
Show Gist options
  • Save janehwzn/5b626a0a35bfe04a1fdb to your computer and use it in GitHub Desktop.
Save janehwzn/5b626a0a35bfe04a1fdb to your computer and use it in GitHub Desktop.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
node->val = node->next->val;
node->next = node->next->next;
return;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment