Guest User

Untitled

a guest
Jul 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. def sortedInsert(x: Int, xs, List[Int]): List[Int] = xs match {
  2. case List() => List(x)
  3. case y :: ys => if (x <= y) x :: xs else y :: sortedInsert(x, ys)
  4. }
Add Comment
Please, Sign In to add comment