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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!