scheme union of two lists
To perform the union of two lists in Scheme, you can use the append
procedure. The append
procedure takes multiple lists as arguments and returns a new list that is the concatenation of all the lists.
Here's an example of how you can use the append
procedure to find the union of two lists:
(define (union lst1 lst2)
(append lst1 lst2))
In this example, the union
procedure takes two lists, lst1
and lst2
, and uses the append
procedure to concatenate them together, resulting in the union of the two lists.