using the  generics method to implement the bubble sort.