Domanda di colloquio di Microsoft

Reverse a doubly linked list.

Risposta di colloquio

Anonimo

4 lug 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