Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ipolacz(list1:Stream[Int], list2:Stream[Int]):Stream[Int]=
- (list1, list2) match{
- case(_, Stream.Empty)=>list1
- case(Stream.Empty,_)=>list2
- case(h1#::t1, h2#::t2)=>
- if(h1<h2)
- h1 #:: ipolacz(t1, list2)
- else
- h2 #:: ipolacz(list1, t2)
- }
- ipolacz(Stream(1,3,5,6,8,12), Stream(2,4,7,9,10,11,13)) force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement