The only built in string functions that you may use

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 00am on Wednesday, February 8 2. A silly list is either • empty, or • (cons 3 (cons 3 (cons 3 L)))), where L is a silly list or, • (cons 1 (append L (list 5 7))) where L is a silly list. Some examples are given in the table below. empty (list (list (list (list (list silly lists 3 1 1 3 3 3 5 3 3 3 3) 7) 3 3 5 7) 3 1 5 7) 3 1 1 3 3 3 5 7 5 7) (list (list (list (list (list (list lists that are not silly lists 3) 3 3 3 "abc") 5 7) 1) 1 5 7 3 3 3) 1 1 5 7 3 3 3 5 7) Write a function is-silly? that consumes a list and produces true if the list is a silly list and false otherwise. Hint: You might want to use reverse. 3. A cyclic shift of a string can be obtained by repeatedly moving the first character to the end of the string. There are at most (string-length s) different cyclic shifts for a string s. For example, the cyclic shifts of "abc" are "bca"...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online