标签:desc 输出 合并链表 tle ret list col return turn
1 public class Solution { 2 public ListNode Merge(ListNode p1,ListNode p2) { 3 if(p1==null) return p2; 4 if(p2==null) return p1; 5 ListNode mhead = null; 6 if(p1.val<p2.val){ 7 mhead = p1; mhead.next = Merge(p1.next,p2); 8 } 9 else{ 10 mhead = p2; 11 mhead.next = Merge(p1,p2.next); 12 } 13 return mhead; 14 } 15 }
标签:desc 输出 合并链表 tle ret list col return turn
原文地址:http://www.cnblogs.com/zle1992/p/7842925.html