It will cover all of the material in the course through Class 16 (Wednesday, 30 Sept) including:
The exam will emphasize understanding the main concepts we have seen in all three of the problem sets, classes, and course book.To prepare for Exam 1:
Office Hours. In addition to my regularly scheduled office hours Monday and Tuesday mornings, I will have additional office hours Thursday 1:30-3pm in Olsson 236A. If none of these times work for you, email me to schedule an appointment.
(define (flatten-commands ll)
(if (null? ll) ll
(if (is-lsystem-command? (car ll))
(cons (car ll) (flatten-commands (cdr ll)))
(flat-append (car ll) (flatten-commands (cdr ll))))))
(define (is-lsystem-command? lcommand)
(or (is-forward? lcommand)
(is-rotate? lcommand)
(is-offshoot? lcommand)))
(define (flat-append lst ll)
(if (null? lst) ll
(cons (car lst) (flat-append (cdr lst) ll))))
What is the asymptotic running time of flatten-commands?
(define (insert-sort lst cf)
(if (null? lst) null
(insert-one (car lst) (insert-sort (cdr lst) cf) cf)))
(define (insert-one el lst cf)
(if (null? lst) (list el)
(if (cf el (car lst)) (cons el lst)
(cons (car lst) (insert-one el (cdr lst) cf)))))