[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/feixiangcode/algorithm/master/Week_01/id_127/LeetCode_21_127.java [Back]  [Original]

/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode(int x) { val = x; }
 * }
 */
class Solution {
    public ListNode mergeTwoLists(ListNode l1, ListNode l2) {
        if (l1 == null)
            return l2;
        if (l2 == null)
            return l1;

        ListNode cur1 = l1;
        ListNode cur2 = l2;
        ListNode mergeCur = null;
        ListNode mergeHead = null;

        if (cur1.val 

Web Proxy Viewer  |  New URL  |  Original Page