Interview Question

Coop-Software Developer Interview(Student Candidate) Waterloo, ON (Canada)

If given an infinite amount of memory, whats the fastest

  way to reverse an array?

Interview Answer

2 Answers


Split the array in half, reverse them, split the two in half, reverse them, etc. until you cannot reverse anymore.

Interview Candidate on Mar 19, 2009

Allocate an array of equal size and write the last index of original array to 0th index of 1st array .. (n-1)th to 1st index and so on

Engineer on Nov 3, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.