03-12-2013, 11:58 AM
def sort(list: List[Int]): List[Int] = {
list match {
case Nil => list
case _ => {
val (low, high) = list.tail.partition(_ <= list.head)
sort(low) ::: list.head :: sort(high)
}
}
}
Que voilà