Show HN: Ipython notebook of data structures and algorithms with unit tests

  • These appear to be homework assignments from someone in a first course in data structures. I would not advise people to use this for their own study.

    The hash table, for example, uses 10 (or a user-defined) set of static chains. This is what https://en.wikibooks.org/wiki/Data_Structures/Hash_Tables#Ch... calls "the simplest chained hash table technique". The stack implements peek() as 'self.arr[len(self.arr)-1]' instead of 'self.arr[-1]'.

    In general, it returns errors by printing a message rather then returning an error code or raising an exception. It also doesn't hook into Python built-in methods like __len__.

    The unittests use __init__() to set up data, rather than setUp() or tearDown(). For that matter, in the tests I looked at the data should be local to the test function, and not through a self.instance variable.