Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object 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))
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement