Merge Two Sorted ListsEasy

linked list two pointers recursion

Splice two already-sorted linked lists into one sorted list. Walk both heads together, attach the smaller node, and advance that list — exactly the merge step of merge sort. Two approaches, same problem: switch between them and watch how time and space trade off.

Press play to merge the two sorted lists.
Metrics
Legend
How it works
0 / 0