Question: Write a function in ML (e) union This function returns the union of two sets. For example, union((3,[2,7,4]), (2,[7,3])) may return (4,[4,2,3,7]) because {2, 7,
Write a function in ML
(e) union
This function returns the union of two sets. For example, union((3,[2,7,4]), (2,[7,3])) may return (4,[4,2,3,7]) because {2, 7, 4} {7, 3} = {4, 2, 3, 7}.
sample execution
val union = fn : (int * int list) * (int * int list) -> int * int lis
- val S' = (3,[4,2,7]);
val S' = (3,[4,2,7]) : int * int list
- val U = (2,[7,3]);
val U = (2,[7,3]) : int * int list
union(S,U);
val it = (4,[4,2,7,3]) : int * int list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
