Bubble sort an array
Bubble sort by given block