Linked List
21. Merge Two Sorted Lists
Both lists are already sorted, so this is exactly the merge phase of merge sort: at each step, take the smaller of the two current heads. No new nodes — you re-link the existing ones, which keeps it…
Loading…
Both lists are already sorted, so this is exactly the merge phase of merge sort: at each step, take the smaller of the two current heads. No new nodes — you re-link the existing ones, which keeps it…
Loading…