Advertisement
Guest User

Untitled

a guest
Nov 4th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.21 KB | None | 0 0
  1. def sortList2(list: List[Long]): List[Long] =
  2.         list match {   
  3.         case Nil => Nil
  4.         case head :: tail =>
  5.           val (before, after) = tail partition (_ < head)
  6.           sortList2(before) ++ (head :: sortList2(after))
  7.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement