Merge Two Sorted Lists

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, and should also be sorted.

For example, given following linked lists :

  5 -> 8 -> 20 
  4 -> 11 -> 15

The merged list should be :

4 -> 5 -> 8 -> 11 -> 15 -> 20
Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
5977 successful submissions.
Asked In:
  • Microsoft
  • Yahoo
Click here to jump start your coding interview preparation