Domanda di colloquio di AMD

Reverse a list

Risposte di colloquio

Anonimo

19 nov 2014

Pretty simple

Anonimo

20 nov 2016

1) Initialize PREVIOUS to null, CURRENT to head, NEXT to null 2) Start with head, go down the list working one element at a time. a) set NEXT to pointer to next element b) set pointer to next element in CURRENT to PREVIOUS c) set PREVIOUS to CURRENT for next iteration d) set CURRENT to NEXT for next iteration 3) set head to PREVIOUS

1