1、注意单链表中找到要删除的结点但无法找到它的前一结点,有个简便方法!!!
2、
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), next(NULL) {} 7 * }; 8 */ 9 class Solution { 10 public: 11 void deleteNode(ListNode* node) { 12 node->val=node->next->val; 13 node->next=node->next->next; 14 } 15 };