Question
Write a function, great-lcm , in Scheme that takes a list of two or more positive integers (duplicates are possible and zero not included) and
Write a function, great-lcm, in Scheme that takes a list of two or more positive integers (duplicates are possible and zero not included) and other auxiliary parameters of your choice. The list L is flat, i.e., it does not contain sublists. The function great-lcm returns the greatest least common multiple of all possible partitions of L. The least common multiple of a partition is defined as the least common multiple of the sums of the two subsets of a partition. You only need to return the greatest lcm.
A partition where a list is separated into two subsets such that every element of the list must be in one or the other subsets but not both and no element can be left out of a split.
The least common multiple of two integers x and y, lcm(x, y), is the smallest positive integer that is divisible by both x and y. For example, lcm(4, 10) = 20. To find the least common multiple of x and y in Scheme you need to use the lcm function. For example, (lcm 3 4) returns 12.
It is up to you to choose the auxiliary parameters that great-lcm takes. All auxiliary parameters must be numeric (not lists or any other types) and should have initial values set to 0. For example, if the list is (1 2 3) and you decide to use two additional auxiliary parameters, great-lcm should be called as follows:
(great-lcm (1 2 3) 0 0)
If there are three auxiliary parameters, then it must be called:
(great-lcm (1 2 3) 0 0 0)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started