Question: Only using these functions/constructs in Scheme: define lambda cond else empty empty? first rest cons list list? = equal? and or not + - *
Only using these functions/constructs in Scheme:
define lambda cond else empty empty? first rest cons list
list? = equal? and or not + - * / < <= > >=
create the function described below.
(remove-duplicates L) The remove-duplicates function takes a simple list L and returns a new list with all of the duplicate objects in L removed.
Examples:
(remove-duplicates '(1 2 3)) => (list 1 2 3)
(remove-duplicates '(1 2 1 4)) => (list 2 1 4) -or- (list 1 2 4)
(remove-duplicates '(3 3 3 3 3)) => (list 3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
