Question: Write a union function in a file named union.sml of type int int list int list int list. It will take two lists that are
Write a union function in a file named union.sml of type int int list int list int list. It will take two lists that are in order from smallest to largest with no duplicates within the list and produce a list with a single copy of all elements from both lists. The resulting list must also be in order from smallest to largest. Make sure you do this efficiently. It should be not Example: union will return
Write an intersection function in a file named intersection.sml This will be much like union, but with the result containing only those elements that appear in both lists. All lists will be in order from smallest to largest, and efficiency matters. Example: intersection will return
Write a findsubset function in a file named findsubset.sml of type int int list int list. It will return a subset of the list that adds up to the first argument. If no such subset can be found, it will return the empty list. Examples:
findsubset should return
findsubset should return
Your resulting list must have the values in the same order and must identify the same subset that is specified here. Under no circumstance will the parameters include or negative numbers for this problem.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
