• + 3 comments
    if (headA == null || headB == null) {	
        return (headA == null) ? headB: headA;		
    }	
    if (headA.data < headB.data) {	
        headA.next = MergeLists(headA.next, headB);			
        return headA;	
    }	
    headB.next = MergeLists(headB.next, headA);		
    return headB;
    

    Do you think this is a bit simpler? I know it tests twice.

    PS: How to attach code?