Problem
1. Describe in detail how to swap two nodes x and y in a singly linked list L given references only to x and y. Repeat this exercise for the case when L is a doubly linked list. Which algorithm takes more time?
2. Describe in detail an algorithm for reversing a singly linked list L using only a constant amount of additional space and not using any recursion.