Pregunta de entrevista de Microsoft

Write a function that reverses an array.

Respuestas de entrevistas

Anónimo

6 de ene de 2018

What areas did the Skype interview cover?

2

Anónimo

19 de dic de 2017

I wrote my function in C++, using a std::vector instead of a C array. The reversal is performed in-place using iterators. template void reverse(std::vector& v) { if (v.size() > 1) for (auto i1 = v.begin(), i2 = v.end() - 1; i1 < i2; ++i1, --i2) std::iter_swap(i1, i2); }