Practice: Sorted Union
Explore how to combine two sorted linked lists into one sorted list without altering the original lists. Understand the intercalation algorithm and local references technique to achieve this efficiently with a single traversal, mastering key linked list manipulation skills in C.
We'll cover the following...
We'll cover the following...
Problem statement
The input consists of two lists in sorted order, and we must construct a new list to represent the reunion of the two lists. The reunion must maintain the sorted order. The two input lists must remain unchanged.
We can only traverse each list at most once. That is, the complexity should be ...