Question: Please use the programming language RACKET Write a structurally recursive function (prefix-of? lst1 lst2) that takes two arguments, both flat lists. Either can be the

Please use the programming language RACKET

Write a structurally recursive function (prefix-of? lst1 lst2) that takes two arguments, both flat lists. Either can be the empty list. prefix-of? returns true if lst2 starts with the items in lst1 in the same order, and false otherwise. For example:

 > (prefix-of? '(cs1510 cs1800) '(cs1510 cs1800 cs1520 cs1410)) #t > (prefix-of? '(cs1510 cs1800) '(cs1510 cs1520 cs1800)) #f

Here is the template to finish

(define prefix-of? (lambda (lst1 lst2) #f))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!