
Create a program in R5RS (a dialect of scheme) to take a list of atleast 2 integers and return the maximum length of two sublists that have the same sum. for example 1,2,3,4 would have sublists of 1,4 and 2,3 and the output would be 2. However if no possible sublists can be made to fit the above criteria return 0. Not all numbers from a list need to be used in the sub lists, for example the list 1,-1,2,-3,4,-2 would have sublists of 1,-1 and 2,-2 and would return 2. So basically find every possible sublist and then return the length of the biggest sublists that have matching sums and lengths, so even the list 4,4 would return 1. This should be done in one recursive function and one cond statement and all parameters excludeing the list should be initialized with values of 0 which should roughly look like:
(define sublists (lambda (List followed by any other parameters)
(cond
code
))).
we can only use null?,car,cdr,else,+,-,=,>,>=,<,<=,if,and,user defined parameters, integer literals, parentheses, and the function for the sake of recursive calling

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

- Can you use Python programming language to to this question? Thanksarrow_forwardIn C++arrow_forwardpython LAB: Subtracting list elements from max When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. Write a program that adjusts a list of values by subtracting each value from the maximum value in the list. The input begins with an integer indicating the number of integers that follow.arrow_forward
- Python code easy way plsarrow_forwardUsing c++ Contact list: Binary Search A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Define and call the following function. The return value of FindContact is the index of the contact with the provided contact name. If the name is not found, the function should return -1 This function should use binary search. Modify the algorithm to output the count of how many comparisons using == with the contactName were performed during the search, before it returns the index (or -1). int FindContact(ContactInfo contacts[], int size, string contactName) Ex: If the input is: 3 Frank 867-5309 Joe…arrow_forwardTask 5 Write a Python program that takes numbers as input into a list, removes multiple occurences of any number and then finally prints a list without duplicate values. Hint: You may create a third list to store the results. You can use membership operators (in, not in) to make sure no duplicates are added. Sample Input 1: 0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4 Sample Output 1: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Sample Input 2: 7, 7, 7, 1, 0, 3, 3, 55, 9 Sample Output 2: [7, 1, 0, 3, 55, 9]arrow_forward
- I need to solve this in C++ code When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain less than 20 integers. Ex: If the input is: 5 30 50 10 70 65 the output is: 20 40 0 60 55 For coding simplicity, follow every output value by a space, even the last one. Your program must define and use the following function:int GetMinimumInt(vector<int> listInts) Note: This is a lab from a previous chapter that now requires the use of a function.arrow_forwardComputer programmingarrow_forwardIn pythonarrow_forward
- in this assignment i have to remove vowels from a string using a linked list. the linked list and link code is from a textbook and cannot be changed if the code alters the data structure. for some reason when i implement this code it gives me a logical error where the program only removes all instances of the first vowel in a string instead of moving through all vowels of the string and removing each one with all instances. i would appreciate if you could tell me the problem and solution in words and not in code. The code is in java. output please enter a string.researchhcraeserfalseList (first -->last): researchList (first -->last): researchList (first -->last): rsarch CODE MAIN FUNCTION import java.util.Scanner;/*** Write a description of class test here.** @author (your name)* @version (a version number or a date)*/public class test{// instance variables - replace the example below with your ownpublic static void main(String[] args){Scanner input = new…arrow_forwardWrite a procedure called check_if_odd_time. The function will be accepting a list as a parameter. The list will contain numbers between 1 and 60 which represent minutes. Analyse the numbers.In the order that the numbers occur in the parameter list. Print the number, followed by the statement "This minute is odd." if it is an odd number. Or print "Not an odd minute." if it is an even number.NB: The apostrophes ("") around the messages are not displayed in the print. They are there to help you copy paste the statements in your code. Look at the output of the examples.Do not call the procedure. For example: Test Result check_if_odd_time([1, 4, 5]) 1This minute is odd.4Not an odd minute.5This minute is odd.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





