import scala.compat.Platform

object Sort_an_integer_array extends App {
  val array = Array((for (i <- 0 to 10) yield scala.util.Random.nextInt()):
    _* )

  
  def isSorted[T](arr: Array[T]) = array.sliding(2).forall(pair => pair(0) <= pair(1))

  assert(!isSorted(array), "Not random")
  scala.util.Sorting.quickSort(array)
  assert(isSorted(array), "Not sorted")

  println(s"Array in sorted order.\nSuccessfully completed without errors. [total ${Platform.currentTime - executionStart} ms]")
}