LeetCode 21. Merge Two Sorted Lists (Java)



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.




We compare the pointer to l1, l2 linked list node one by one. The smaller list node would be added to the new linked list.

Video Tutorial

Java Solution

3 Thoughts to “LeetCode 21. Merge Two Sorted Lists (Java)”

Leave a Reply

Your email address will not be published. Required fields are marked *