Microsoft interview question

Reverse a doubly linked list.

Interview Answer

Anonymous

4 July 2017

Start at the head of the list. For each node - reverse the "next" and "prev" links. Go to next node (which means follow the "prev" link) When you finish - link the head to the last node (now becomes first node).

2