Skip to content

Update lab2

Simon Sundberg requested to merge simosund/dvgb03:lab2_updates into master

This PR addresses some of the things we lab supervisors discussed regarding lab2 after the HT22 instance of DVGB03.

  • The first commit changes the example of overriding a parent method to use the super() method instead of the rather confusing bst.BST.add(self, v) syntax.
  • The second commit renames the lc(), rc() and value() methods to get_lc(), get_rc() and get_value(). This should hopefully clarify that these are indeed methods and not variables and prevent students from treating them like variables (i.e. remember to use parentheses and not try to assign to them).
  • The third commit is just a couple of minor fixes for ui.py which I though I would throw in while I was at it.
  • The fourth commit updates the input files to try a delete from an empty tree, allowing students to easily test that their implementations to handle the empty case correctly. Also updates the output to reflect these changes.

In the future, a similar update should be done for lab3 (to rename getter methods to better reflect that they are getter methods).

Merge request reports