Skip to content

Instantly share code, notes, and snippets.

@akirillov
Created October 13, 2014 09:45
Show Gist options
  • Save akirillov/436be17d83fbb8eac0be to your computer and use it in GitHub Desktop.
Save akirillov/436be17d83fbb8eac0be to your computer and use it in GitHub Desktop.
Scala QuickSort
def sort(list: List[Int]): List[Int] = {
list match {
case Nil => list
case _ => sort(list.tail.filter(_ <= list.head)) ::: list.head :: sort(list.tail.filter(_ > list.head))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment