148

Prep 9: Expression Trees

This week’s prep introduces a new recursive data structure, the expression tree, which is the last major tree-based data structure we’ll study in this course. Note that even though the underlying tree structure is the same as the general tree structure we’ve studied before, the implementation uses a rather different approach!

Readings to complete

Comprehension questions

Complete the Prep 9 quiz: Expression Trees quiz on Quercus.

Synthesize (submit on MarkUs)

This week’s programming exercises are all about taking the given expression tree classes from the prep reading and extending it to cover a few more kinds of expressions. Please find our detailed instructions in the starter code.

Note: while we’ve provided some doctests, we haven’t provided any additional sample tests this week. However, we strongly encourage you add your own tests to verify that your code is correct!

When you’re done, submit prep9.py on MarkUs.