148

Prep 7: Trees

This week’s prep introduces a new recursive data structure, the tree, which is similar to the nested list structure we’ve already seen, We’ll first define what a tree is, look at how to represent one in Python, and then get to work implementing recursive functions that operate on them.

Readings to complete

Comprehension questions

Complete the Prep 7 quiz: Trees quiz on Quercus.

Synthesize (submit on MarkUs)

This week’s programming exercises are all about getting comfortable working with trees. 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 prep7.py on MarkUs.