Microsoft Interview Question

Describe an algorithm that reverse a string.

Interview Answer

Anonymous

Jan 2, 2017

Starting iterations from first and last indexed element, swap array elements using temporary variable for values (or pointers or addresses - depends on realisation) until first index is greater or equals to last index, increasing start index and decreasing last index at the end of each loop iteration