scala冒泡排序: object Maopao { def main(args: Array[String]) { val list = List(1, 23, 432, 10, 23, 42, 3, 23, 8, 23, 4) print(sort2(list)) println() val arr = Array(2, 5, 6, 7, 8, 10, 34, 656, 3) sort(arr) printArr(arr) } //基本的冒泡排序,类似java写法 def sort(arr:…