BlackBerry

  www.blackberry.com
  www.blackberry.com

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?
Answer

Interview Answer

2 Answers

0

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
3

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.