Frage im Vorstellungsgespräch bei Google

Reverse an sequence, or array

Antwort im Vorstellungsgespräch

Anonym

10. Sep. 2010

1. Swap elements from two ends till the middle element is reached. 2. Use an outer stack as buffer. 3. If the sequence is represented as a linked list, we can also manipulate the pointers of the nodes to reverse the direction.