Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This has to be done in the Scheme programming language. I\'ve already gotten a f

ID: 3884668 • Letter: T

Question

This has to be done in the Scheme programming language.
I've already gotten a fair amount into it if it helps. My implementation only works on a list without lists inside (ex: (1 2 3 4) and not (1 2 (3 4)).
Here's my code
(define (deep-delete V L)           ;Deletes all instances of the value V in list L
   (if (null? L)                      ;If L is empty, there is nothing to delete
       L                                         ;base case
       (if (= V (car L))           ;If value V is the first element in L
           (deep-delete V (cdr L))   ;forget about(delete) the first element (value V) and look at the next element
           (cons (car L) (deep-delete V (cdr L)))   ;The first value in L isnt V, so it gets to stay. Run deep-delete on the rest of the list.
       )
   )      
)

Explanation / Answer

You can use the following code it will work fine

Thanking You

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote