Question: Part 2 Ma fil king Procedures- Define the following five scheme procedures and store them in a single scheme le name yourlastnamel.rkt. Defining helper procedures
Part 2 Ma fil king Procedures- Define the following five scheme procedures and store them in a single scheme le name "yourlastnamel.rkt". Defining helper procedures may be useful in solving some of these problems. o include your name as comments at the beginning of the file. (15x4-60 points) double7 - a function which expects as argument a list of integers, and return a list with all 7s doubled. You may assume there is no sublist. (double7 (1 2717 72 7 3) (1 2 14 17 72 143) - a function which expects as argument a list of integers, and return a list with all 7s doubled, followed by the symbol bond, including those in sub-list. (doubleAl17 '(7 5 (3 7 (12 77 7)))) (7 bond 5 (3 7 bond (12 77 7 bond))) 3. merge - a function which expects two sorted lists of numbers and returns a single sorted list containing exactly the same elements as the two argument lists together: (merge '(123)(456)) (123456) (merge (1 3 5) (2 4 6)) (123456) 4. interleave - a fiunction which expects as arguments two lists L1 and L2, and returns a single list obtained by choosing elements alternately, first from L1 and then from L2. When either L1 or L2 runs out, it takes the remaining elements from the other list, so that the elements of the result are exactly the elements of the t argument lists taken together. (interleave '(1 2 3) '(a b c)) (1 a 2 b 3 c) (interleave (1 2 3) (a b c def) (I a 2 b3cdef)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
