Guest User

Untitled

a guest
Jul 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. def sort(array: Array[Int]): Array[Int] = {
  2. if (array.length < 2) array
  3. else {
  4. val pivot = array(array.length / 2) sort(array filter(pivot >)) ++ (array filter(pivot ==)) ++ sort(array filter(pivot <))
  5. }
  6. }
Add Comment
Please, Sign In to add comment