Move the two output list pointers to the two input list pointers. Set the two output list pointers to NULL. Move the first item from the first input list over to the first output list. Loop while there are items in either of the two input lists { Select a node to remove from the appropriate input list. Determine which output list to send the node to. Move the node selected into the appropriate output list. }
Example 1: The algorithm.
Copyright © 1999, Dr. Dobb's Journal