BookmarkBookmarked What does the following Scheme function d

BookmarkBookmarked

What does the following Scheme function do?

(define (y s lis)

(cond ((null? lis) \'() )

((equal? s (car lis)) lis)

(else (y s (cdr lis)))

))

Solution

What does the following Scheme function do?

(define (y s lis)

(cond ((null? lis) \'() )

((equal? s (car lis)) lis)

(else (y s (cdr lis)))

))

Answer:-

y returns the given list with leading elements removed up to but not including the first occurrence of the first given parameter.

BookmarkBookmarked What does the following Scheme function do? (define (y s lis) (cond ((null? lis) \'() ) ((equal? s (car lis)) lis) (else (y s (cdr lis))) ))S

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site