C++

# ifndef __BUBBLESORT_HEADER__
# define __BUBBLESORT_HEADER__

# include <something>

template <class itemType, class indexType=int>
void BubbleSort(itemType a[], indexType l, indexType r)
{
  static indexType i, j;

  for(i=r; i>l; --i)
    for(j=l; j<i; ++j)
      if(a[j] > a[j+1]) std::swap(a[j], a[j+1]);
}

# endif