摘要: ```c++ ListNode *removeElements(ListNode *head, int val) { if (head == nullptr) return head; auto *prehead = new ListNode(-1); prehead->next = head; hea... 阅读全文
posted @ 2018-12-25 21:59 INnoVation-V2 阅读(86) 评论(0) 推荐(0) 编辑
摘要: ```c++ ListNode *deleteDuplicates(ListNode *head) { if (head == nullptr || head->next == nullptr) return head; ListNode *temp = head; int save = temp->val; ... 阅读全文
posted @ 2018-12-25 19:57 INnoVation-V2 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 61 旋转链表 一般解法 好一点解法 阅读全文
posted @ 2018-12-25 19:30 INnoVation-V2 阅读(92) 评论(0) 推荐(0) 编辑
摘要: ```c++ ListNode *swapPairs(ListNode *head) { if (head == nullptr || head->next == nullptr) return head; ListNode *it = head; head = head->next; it->next... 阅读全文
posted @ 2018-12-25 11:54 INnoVation-V2 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 2.删除链表倒数第N个节点 普通方法 空间换时间(似乎没什么卵用) 阅读全文
posted @ 2018-12-25 01:44 INnoVation-V2 阅读(112) 评论(0) 推荐(0) 编辑
摘要: ```c++ ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) { if (l1->next == nullptr && l1->val == 0) return l2; else if (l2->next == nullptr && l2->val == 0) ... 阅读全文
posted @ 2018-12-25 00:58 INnoVation-V2 阅读(118) 评论(0) 推荐(0) 编辑