Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. def insertionSortFoldLeft[A <% Ordered[A]](list: List[A]): List[A] ={
  2. list.foldLeft(List.empty[A]){(r,e) => val (first, last) = r.span(_ < e)
  3. first ::: e :: last
  4. }
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement