Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def max(ints: IndexedSeq[Int]) : Par[Int] =
- if (ints.size == 1) Par.unit(ints.head)
- else {
- val (l, r) = ints.splitAt(ints.length / 2)
- Par.map2(Par.fork(max(l)), Par.fork(max(r)))((a, b) => if (a > b) a else b)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement