Easy_MergeTwoSortedLists_21

2017-08-29  本文已影响0人  小滚猪

/**

* Merge two sorted linked lists and return it as a new list. The new list should be made by

* splicing together the nodes of the first two lists.

合并两个有序链表

*/

首先创建一个单链表节点结构

使用 递归方式遍历链表,使用compareTo 方法比较链表里的数值大小

上一篇 下一篇

猜你喜欢

热点阅读