Skip to content

Instantly share code, notes, and snippets.

@jacks205
Created December 5, 2014 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacks205/051009234c57ca74a73f to your computer and use it in GitHub Desktop.
Save jacks205/051009234c57ca74a73f to your computer and use it in GitHub Desktop.
static int[] bubblesort(int[] numbers)
{
int tempVar;
for (int i = 0; i < numbers.length; i++)
{
for(int j = 0; j < numbers.length; j++)
{
if(numbers[i] > numbers[j + 1])
{
tempVar = numbers [j + 1];
numbers [j + 1]= numbers [i];
numbers [i] = tempVar;
}
}
}
return numbers;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment