Problem Set 11
Purpose: to practice designing functions that consume two complex inputs.
Due: Wednesday, April 8 at 7pm
Problem 1: Exercise 322 from HtDP/2e
Problem 2: Exercise 323 from HtDP/2e
Problem 3: Exercise 324 from HtDP/2e
Problem 4: Exercise 328 from HtDP/2e
Problem 5: Exercise 330 from HtDP/2e
Problem 6: Exercise 333 from HtDP/2e
Problem 7: Recall that S-expressions are defined as:
;;; An Atom is one of: |
;;; - Number |
;;; - Symbol |
;;; - String |
;;; |
;;; An SExp is one of: |
;;; - Atom |
;;; - [List-of SExp] |
;;; |
;;; SL [List-of SExp] is one of: |
;;; - empty |
;;; - (cons SExp SL) |
Develop the templates for a function that consumes two SExps.
Design a program that will determine if two SExps contain the same atoms regardless of the ordering. For example:
(contains-same-atoms? '(1 2 3 () ("r" b)) '("r" 1 (2) 3 b))
would return true.
Do not solve this by flattening SExps into [List-of Atom] first.