// // Function to sort an array of numbers using bubble sort. // def bubbleSort(nums : Array[Int]) { for (stopIndex <- nums.size-2 to 1 by -1) { println("nums " + nums.mkString(" ")) for (j <- 0 to stopIndex) { if (nums(j+1) < nums(j)) { val temp = nums(j) nums(j) = nums(j+1) nums(j+1) = temp } } } }