For Earth Day today, we looked at binary trees with my IB Computer Science class.
We’re studying abstract data structures, so last week we used BYOB to create stacks and queues with new blocks for all the associated methods you would normally expect with each structure.
The BYOB tutorials cover trees, so I decided to start with with a presentation using Google slides, and a simple scratch implementation, using a set of lists to store the data structure. It would be possible to use a single list to store this data, but that would be less straight-forwards for someone to change.
Then we went on to do tree traversals…