Question d’entretien chez Morgan Stanley

How to reverse a string in place.

Réponse à la question d'entretien

Utilisateur anonyme

23 oct. 2012

Just have two indexes --- one from the start of the string, and one from the end of the string. Move each index inwards towards the middle of the string, swapping the elements as you go. Runs in O(n) time. i