We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
/** * @param {ListNode} list1 * @param {ListNode} list2 * @return {ListNode} */ var mergeTwoLists = function (l1, l2) { if (!l1) { return l2; } else if (!l2) { return l1 } else if(l1.val < l2.val){ //两个链表中头结点小的那个return l1.next = mergeTwoLists(l1.next,l2); // l1的头结点小于l2的头结点,递归比较l1.next和l2哪个小 return l1;//最终返回的都是小的那个值,达到合并之后递增的目的 } else{ l2.next = mergeTwoLists(l1,l2.next); return l2; } };
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: