### Review Session

##### Sunday, May 12th, 1pm, SP 309

- Study Advice
- Open book / open note
- Spring 2017 final exam: PDF
- we can go over these questions today, time permitting
- Solutions: spr19-sample-final.rkt

- Use DrRacket to view course notes, assignments, and labs only. May not use the Stepper or hit the Run button
- Cumulative, but with emphasis on topics we've covered since the last midterm
- Understanding abstraction and higher order functions in general will be important
- Understanding the last two labs, more specifically, will be important
- My solutions to last three labs are posted!

- Budget your time: 100 points / 100 minutes
- Points for each question will be indicated. It will be 25 points (minutes) for each question
- Exam period is 2 hours (120 minutes), so you should have more time than you need.

- Promises
**Q1:**writing functions for trees. I give you the data definition(s) and a sketch of a tree, you translate the tree into data example(s). Then write a function that consumes a tree based on given data definition.**Q2:**abstracting over two functions, like we did with +, *, and foldr; and in the “toast” lab. Stages:- design a more general, parameterized version of the two given similar functions
- use the new parameterized function to rewrite the two original functions
- generalize the function even more by adding a predicate function as a parameter, making it a higher order function
- write a new function, using the higher order function within a local expression that defines a predicate function
- finally, replace the locally defined predicate function with an equivalent lambda expression.

**Q3:**using higher order functions to gradually simplify your the design of a function. Stages:- define top-level function
- define a new function that passes the previous top-level function to map, fold, or filter
- revise the last function to use a local expression
- replace the local expression with an anonymous (lambda) function

**Q4:**using and evaluating higher order functions over lists: filter, map, foldr, andmap, ormap