Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def dajPierwsze[A](list:List[A], i:Int):List[A] = {
- if(list == Nil) Nil
- else if (i < 0) Nil
- else if (i == 0) dajPierwsze(list.tail, 0)
- else list.head::dajPierwsze(list.tail, i-1)
- }
- def dajReszte[A](list:List[A], i:Int):List[A] = {
- if(list == Nil) Nil
- else if (i < 0) list
- else if (i == 0) list
- else dajPierwsze(list.tail, i-1)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement