Bubble sort function for Generic