The lecture had begun with an explanation of the test 2. It
would be about linked list, recursion, and trees which we worked on this
lecture8 and the last lecture. Binary Trees consist three parameters: data of a
node, left child, and right child. The child could be Binary Tree. If trees are
equal, this means that all nodes, subtrees, should be same as well. __eq__ of
self and other of Binary Tree was explained, and __eq__ is a special method and
is a recursive definition. __str__ is a method to show a tree in a readable
way. Contains is a project to check whether a value is contained in a tree with
recursion. Evaluates is a project to calculate a result of the tree when a
root/s in the Arithmetic Expression. BST is another type of tree to organize
data. Until here is what will be on the test 2.
No comments:
Post a Comment