Skip to main content

Merge Linked Lists

Learn Merge Linked Lists (Linked List, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Merging Two Sorted Linked Lists Given two already-sorted linked lists, merge them into one sorted list in O(n + m) time and O(1) extra space (reusing existing nodes) - the same core comparison step as the merge phase of Merge Sort, just applied to linked nodes instead of array slots.

More lessons in Linked List