Do I need a bubble sort or something easier?
You could do a qsort. You haven't posted any data types so it is hard to answer with your specific code, however here is a sample of sorting numbers:

const int COUNT = 10;

int someNumbers [COUNT] = { 7342, 54, 21, 42, 18, -5, 30, 998, 999, 3  };

// callback function for doing comparisons
int myCompareFunction (const void * arg1, const void * arg2)
  {
  int * a = (int *) arg1;  // cast to pointers to integers
  int * b = (int *) arg2;

  // a less than b? 
  if (*a &lt; *b)
    return -1;

  // a greater than b?
  if (*a &gt; *b)
    return 1;

  // must be equal
  return 0;
  }  // end of myCompareFunction

void setup ()
  {
  Serial.begin (115200);
  while (!Serial) { }  // for Leonardo
  Serial.println ();
  // sort using custom compare function
  qsort (someNumbers, COUNT, sizeof (int), myCompareFunction);
  for (int i = 0; i &lt; COUNT; i++)
    Serial.println (someNumbers [i]);
  }  // end of setup

void loop () { }


Output:

-5
3
18
21
30
42
54
998
999
7342




Generic compare function with a template

Interestingly, you can make the compare function be a template which lets you compare any type -- that is, any type that supports direct comparisons. Change the compare function to:

// callback function for doing comparisons
template&lt;typename T&gt;
int myCompareFunction (const void * arg1, const void * arg2)
  {
  T * a = (T *) arg1;  // cast to pointers to type T
  T * b = (T *) arg2;
  // a less than b? 
  if (*a &lt; *b)
    return -1;
  // a greater than b?
  if (*a &gt; *b)
    return 1;
  // must be equal
  return 0;
  }  // end of myCompareFunction


This change removes the reference to "a" and "b" being "int" and replaces them with T, which is the template type.

Now we can change the qsort line to be:

  // sort using custom compare function
  qsort (someNumbers, COUNT, sizeof (int), myCompareFunction&lt;int&gt;);
  // -------add this----------------------------------------^^^^^


That gives the same results, but now we can also compare float, long, unsigned long, byte, all that sort of thing. 



Compare floats

For example to compare floats:

const int COUNT = 10;

float someNumbers [COUNT] = { 7342, 54, 21, 42, 18, -5, 30, 998, 999, 3  };

// callback function for doing comparisons
template&lt;typename T&gt;
int myCompareFunction (const void * arg1, const void * arg2)
  {
  T * a = (T *) arg1;  // cast to pointers to type T
  T * b = (T *) arg2;
  // a less than b? 
  if (*a &lt; *b)
    return -1;
  // a greater than b?
  if (*a &gt; *b)
    return 1;
  // must be equal
  return 0;
  }  // end of myCompareFunction

void setup ()
  {
  Serial.begin (115200);
  while (!Serial) { }  // for Leonardo
  Serial.println ();
  // sort using custom compare function
  qsort (someNumbers, COUNT, sizeof (float), myCompareFunction&lt;float&gt;);
  for (int i = 0; i &lt; COUNT; i++)
    Serial.println (someNumbers [i]);
  }  // end of setup

void loop () { }


The only change there was changing the word "int" to "float" (in two places) on the qsort line, and on the data declaration itself.



Compare String objects

You can even compare String objects (not C strings), for example the data is:

String someStrings [COUNT] = { "the", "quick", "brown", "fox", "jumped", 
                               "over", "the", "lazy", "dog", "ZOMG"  };


And the sort is:

  // sort using custom compare function
  qsort (someStrings, COUNT, sizeof (String), myCompareFunction&lt;String&gt;);
  for (int i = 0; i &lt; COUNT; i++)
    Serial.println (someStrings [i]);




Compare C strings

We need to use strcmp in this case, but most of the work is done in that. We just have to dereference the pointer so strcmp gets the pointer to the string (not the pointer to the pointer to the string).

char * someStrings [COUNT] = { "the", "quick", "brown", "fox", "jumped", 
                               "over", "the", "lazy", "dog", "ZOMG"  };

int myCompareFunction (const void * arg1, const void * arg2)
  {
  return strcmp (*(char **) arg1, *(char **) arg2);
  }  // end of myCompareFunction

void setup ()
  {
  Serial.begin (115200);
  while (!Serial) { }  // for Leonardo
  Serial.println ();
  // sort using custom compare function
  qsort (someStrings, COUNT, sizeof (char *), myCompareFunction);
  for (int i = 0; i &lt; COUNT; i++)
    Serial.println (someStrings [i]);
  }  // end of setup

void loop () { }