The writer is very fast, professional and responded to the review request fast also. Thank you.
Your code must be written in R5RS!
Write a function two-subsets in Scheme that takes a list L of positive integers (duplicates are possible, zero is not considered a positive integer) and some auxiliary parameters of your choice. The function two-subsets returns #t if the list L contains two subsets with equal sums of elements and with equal numbers of elements. Otherwise (if two subsets satisfying the condition above do not exist), the function returns #f. Assume that the list L contains at least two integers.
It is up to you to choose the auxiliary parameters that two-subsets takes. All auxiliary parameters must be numeric (not lists) and should have initial values set to zero. For example, if L is ‘(1 2 3) and if you decide to use two additional auxiliary parameters, then two-subsets must be called as follows:
(two-subsets ‘(1 2 3) 0 0)
If there are three auxiliary parameters, then the function must be called: (two-subsets ‘(1 2 3) 0 0 0) and so on.
Examples
(two-subsets ‘(5 3 21 2 4) 0 0) returns #t. The two subsets are {2, 5} and {3, 4}. (two-subsets ‘(2 13 7 5 16 11) 0 0) returns #t. The two subsets are {7, 11} and
{5, 13}.
(two-subsets ‘(1 2 3 6 9) 0 0) returns #f.
You can use ONLY the following constructs:
– null?
cond
car
cdr
else
–
+
=
– not
– and
– #t
– #f
– two-subsets
– the names of your parameters, such as list, sum, etc. – numeric constants, such as 0, 1, 2, etc.
– parentheses
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more