Question: Write a polymorphic function, shuffle, which takes two lists l1 and l2 representing decks of cards, and returns the result of a combining of the
Write a polymorphic function, shuffle, which takes two lists l1 and l2 representing decks of cards, and returns the result of a combining of the lists. Particularly, the returned list contains the first element of l1, followed by the first element of l2, followed by the second element of l1, and so on. If one of the lists ends before the other, the other lists remaining elements are simply added to the end.
Programming language: Scala
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
