June 2019
Beginner to intermediate
770 pages
19h 24m
English
We're going to split the collection into two classes: TreeNode and Tree. This will allow us to separate the design into the essential data collection, and a Pythonic Façade design pattern required to match other collections.
The TreeNode class will contain the item as well as the more, less, and parent references. This is the core collection of values. It handles insertion and removal. Also, searching for a particular item in order to use __contains__() or discard() will be delegated to the TreeNode class.
The essential search algorithm's outline looks like this.
Read now
Unlock full access