Question: Please show me in scheme please. 1. A) Write a function in Scheme to return 1, 0, +1 depending on two parameters a and b:

Please show me in scheme please.

1.

A) Write a function in Scheme to return 1, 0, +1 depending on two parameters a and b:

a < b return 1

a > b return +1

a = b return 0

b) Write a recursive function in Scheme, called get-element which takes two parameters, an index and a list. The function returns the element at the given index position in the list or #f if element is not contained. Indices start at 1 and go to the length of the list.

C) Question: How would you change the function so it returns the whole list if the element is not contained?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!