O users. enos oncardia.ca 2/notes/COMP348 assignment 2 FALL 2016.pdf NY-c348 of
ID: 3779276 • Letter: O
Question
O users. enos oncardia.ca 2/notes/COMP348 assignment 2 FALL 2016.pdf NY-c348 of 8 a) Assume L is list of only integer numbers (Including zeros, or positive, or negative numbers, or could be an empty list), write a recursive function so- called "filter-odds" in order to remove all the odd numbers from this list and return a new list containing only even elements of this list Example: for Lin (-7, 17, 8, 2, 9, 16, 19, 0, 27, 28, 13), you should return: Lout 8, 2, 16, 0, 28) b) Test your function on your computer by some (at least 3 examples) examples of different values for its input parameter (L) and show your code and results of your examples for this function. A Bea ENG 1041 PM US 2016- Ask me anythingExplanation / Answer
this is the program to return the even number from a given list using lisp hope u understand it well (defun find-even (L) "Given a list L of numbers, return the leftmost even member." (if (null L) nil (if (evenp (first L)) (first L) (find-even (rest L)))))
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.