摘要:
ListNode* reverseList(ListNode* head) { ListNode* tail=NULL; ListNode* front=head; ListNode* curr=NULL; //先令curr指向front,front移动下一个,curr的next指向tail实现反转 阅读全文
posted @ 2022-10-06 11:47
lwx_R
阅读(14)
评论(0)
推荐(0)
摘要:
ListNode* getKthFromEnd(ListNode* head, int k) { ListNode* fast=head; ListNode* slow=head; //因为头结点开始 所以要从1开始 for(int i=1;i<k;i++){ fast=fast->next; // 阅读全文
posted @ 2022-10-06 11:45
lwx_R
阅读(22)
评论(0)
推荐(0)
摘要:
ListNode* deleteNode(ListNode* head, int val) { if(head->val == val){ head=head->next; return head; } ListNode* front=head->next; ListNode* tail=head; 阅读全文
posted @ 2022-10-06 11:44
lwx_R
阅读(53)
评论(0)
推荐(0)

浙公网安备 33010602011771号