Problem
1. Describe a good algorithm for concatenating two singly linked lists L and M, with header sentinels, into a single list L ′ that contains all the nodes of L followed by all the nodes of M.
2. Give a fast algorithm for concatenating two doubly linked lists L and M, with header and trailer sentinel nodes, into a single list L ′.