【leetcode】14. Merge two sorted lists 合并两个排序列表

这个题目用到了链表,实质就是将两个有序链表进行合并,合并后的链表应该也是有序的。 具体代码为: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} *
相关文章
相关标签/搜索