摘要:
```c++ ListNode *removeElements(ListNode *head, int val) { if (head == nullptr) return head; auto *prehead = new ListNode(-1); prehead->next = head; hea... 阅读全文
摘要:
```c++ ListNode *deleteDuplicates(ListNode *head) { if (head == nullptr || head->next == nullptr) return head; ListNode *temp = head; int save = temp->val; ... 阅读全文
摘要:
61 旋转链表 一般解法 好一点解法 阅读全文
摘要:
```c++ ListNode *swapPairs(ListNode *head) { if (head == nullptr || head->next == nullptr) return head; ListNode *it = head; head = head->next; it->next... 阅读全文
摘要:
2.删除链表倒数第N个节点 普通方法 空间换时间(似乎没什么卵用) 阅读全文
摘要:
```c++ ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) { if (l1->next == nullptr && l1->val == 0) return l2; else if (l2->next == nullptr && l2->val == 0) ... 阅读全文