LeetCode 21 Merge k Sorted Lists 题解
1.题目:
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
题意:
合并K个有序链表
2.解题思路:
用21题的方法,加上递归,两两合并再合并。
3.代码
1 |
|
很高兴遇见你~
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
题意:
合并K个有序链表
用21题的方法,加上递归,两两合并再合并。
1 |
|