Question: 1. Define a recursive function ALL-SAME-AS-ELEMENT that has two arguments, an atom and a list. ALL-SAME-AS-ELEMENT should test whether all the elements in the list
1. Define a recursive function ALL-SAME-AS-ELEMENT that has two arguments, an atom and a list. ALL-SAME-AS-ELEMENT should test whether all the elements in the list are the same as the atom. Should this be the case, the value returned should be T, otherwise NIL. Examples: (ALL-SAME-AS-ELEMENT 'X '(X X X)) (Links to an external site.) T (ALL-SAME-AS-ELEMENT 'Y '(X Y X)) (Links to an external site.) NIL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
