ListNode* newHead =NULL;//指向合并后链表第一个结点 if(NULL== pHead1){ returnpHead2; }elseif(NULL== pHead2){ returnpHead1; }else{ //确定头指针 if( pHead1->data < pHead2->data){ newHead = pHead1; pHead1 = pHead1->next;//指向链表的第二个结点 }else{ newHead = pHead2...
struct ListNode* reverseKGroup(struct ListNode* head, int k ) { if(head == NULL || head->next == NULL || k<2) return head; struct ListNode* newhead = (struct ListNode*)malloc(sizeof(struct ListNode)); newhead->val = -1; newhead->next = head; struct ListNode* pre = newhead...