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.

Solution: classic merge sort.

Redo this (Sep. 5, 2013), bug free! Instead of tracking the previous nodes for both linked lists, use common previous node.

Comments

Popular posts from this blog

Maximum Gap

[ITint5] Maximum Subarray for a Circular Array

[CC150] Chapter 4 Trees and Graphs