Question: Use ML patterns to write a function union ( S 1 , S 2 ) that returns the union of sets S 1 and S
Use ML patterns to write a function union S S that returns the union of sets S and S We implement sets as unordered lists of elements, without repetitions. Hint: usecall the function member from Q to check whether an element belongs to a set or not.
I used this code as my function member for Q:
fun membereL
if null L
then false
else if e hdL
then true
else memberetlL;
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
