合并 2 个有序链表(Merge Two Sorted Lists)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
- [合并 2 个有序链表]()
|
||||
- [带环链表](/algorithm/linked-list-cycle.md)
|
||||
- [电话号码的字母组合](/algorithm/letter-combinations-of-a-phone-number.md)
|
||||
- [格雷编码](/algorithm/gray-code.md)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# 合并 2 个有序链表(Merge Two Sorted Lists)
|
||||
|
||||
> 🔔 参与讨论:https://www.isharkfly.com/t/2-merge-two-sorted-lists/15123
|
||||
|
||||
## 描述
|
||||
|
||||
将两个排序链表合并为一个新的排序链表。
|
||||
|
||||
## 样例
|
||||
|
||||
给出 `1->3->8->11->15->null`,`2->null`, 返回 `1->2->3->8->11->15->null`。
|
||||
|
||||
## 代码
|
||||
|
||||
GitHub 的源代码,请访问下面的链接:
|
||||
https://github.com/honeymoose/codebank-algorithm/blob/main/src/test/java/com/ossez/codebank/algorithm/tests/lintcode/LintCode0165MergeTwoListsTest.java
|
||||
|
||||
## 点评
|
||||
|
||||
本题主要涉及到链表的遍历和比较,基本上不会太难。
|
||||
|
||||
可能在写法上有点绕。
|
||||
Reference in New Issue
Block a user