Question: 1. Define a function called countMatches that accepts a function and a list and resolves to the number of elements matching the criteria indicated by

1. Define a function called countMatches that accepts a function and a list and resolves to the number of elements matching the criteria indicated by the function. Example: (countMatches (lambda (x) (< x 5)) '(1 9 3 8 7 4 5 6)) resolves to 3.

2. Define a function called reverseList that accepts a list and resolves to the list in reverse order. Example: (reverseList '(1 9 3 8 7 4 5 6)) resolves to (6 5 4 7 8 3 9 1).

3. Define a function called removeDups that accepts a function and a list (which you can assume is already sorted) and resolves to a new list with the duplicates removed. Example: (removeDups '(1 1 2 3 4 4 5 8 8 8 )) resolves to (1 2 3 4 5 8).

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!