Question d’entretien chez Google

Reverse a linked list

Réponse à la question d'entretien

Utilisateur anonyme

5 déc. 2018

The best answer i could think of in 6 minutes is to iterate through List removing the elements and adding them to stack and start taking them back from stack when list is empty. Stack is LIFO so the last list element would be the first one we would get.