实例要求:将两个升序链表合并为一个新的 升序 链表并返回;新链表是通过拼接给定的两个链表的所有节点组成的;实例分析:先拼接两个链表,在使用冒泡排序即可;示例代码: struct ListNode* mergeTwoLists(struct ListNode* list1, struct ListNode* list2){if(NULL == list1 ){return list2;}if(NULL == list2){return list1;}struct ListNode *p = list1;while(p->next != NULL){p = p->next;}p->next = list2;struct ListNode *q = NULL;int temp = 0;p = list1;while(NULL != p->next){q = p->next;while(NULL != q){if(p->val > q->val){temp = p->val;p->val = q->val;q->val = temp;}q = q->next;}p = p->next;}return list1;} 运行结果: