Microsoft Interview Question

Reverse a linked list.

Interview Answer

Anonymous

Mar 3, 2010

LinkedList *SomeList,previous,current,Next; current = SomeList; previous = null; while(current) { Next = current->pNext; current->pNext = Previous; Previous = current; current = Next; }