Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sortList2(list: List[Long]): List[Long] =
- list match {
- case Nil => Nil
- case head :: tail =>
- val (before, after) = tail partition (_ < head)
- sortList2(before) ++ (head :: sortList2(after))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement