美文网首页
Easy_MergeTwoSortedLists_21

Easy_MergeTwoSortedLists_21

作者: 小滚猪 | 来源:发表于2017-08-29 19:20 被阅读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 方法比较链表里的数值大小

相关文章

网友评论

      本文标题:Easy_MergeTwoSortedLists_21

      本文链接:https://www.haomeiwen.com/subject/dkqcdxtx.html