摘要:
1 class Solution { 2 public: 3 ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { 4 ListNode* head = new ListNode(0); 5 ListNode* res = head; 6 whi 阅读全文
摘要:
1 class Solution { 2 public: 3 int length(ListNode* head){ 4 ListNode* tmp = head; 5 int len = 0; 6 while(tmp != NULL){ 7 ++ len; 8 tmp = tmp->next; 9 阅读全文
摘要:
1 class Solution { 2 public: 3 void deleteNode(ListNode* node) { 4 if(node == NULL || node->next == NULL){ 5 node = NULL; 6 return; 7 } 8 ListNode* tm 阅读全文