Skip to content

Instantly share code, notes, and snippets.

@bigworld12
Created December 31, 2016 14:37
Show Gist options
  • Save bigworld12/44ac83d43c418e817f0b81d988c3fd83 to your computer and use it in GitHub Desktop.
Save bigworld12/44ac83d43c418e817f0b81d988c3fd83 to your computer and use it in GitHub Desktop.
static void Reverse(int[] arr)
{
int[] buffer = new int[arr.Length];
for (int i = 0; i < arr.Length; i++)
{
buffer[arr.Length - 1 - i] = arr[i];
}
for (int i = 0; i < arr.Length; i++)
{
arr[i] = buffer[i];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment