TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

4 pointsby pattu777almost 9 years ago

1 comment

dalkealmost 9 years ago
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.<p>The hash table, for example, uses 10 (or a user-defined) set of static chains. This is what <a href="https:&#x2F;&#x2F;en.wikibooks.org&#x2F;wiki&#x2F;Data_Structures&#x2F;Hash_Tables#Chaining" rel="nofollow">https:&#x2F;&#x2F;en.wikibooks.org&#x2F;wiki&#x2F;Data_Structures&#x2F;Hash_Tables#Ch...</a> calls &quot;the simplest chained hash table technique&quot;. The stack implements peek() as &#x27;self.arr[len(self.arr)-1]&#x27; instead of &#x27;self.arr[-1]&#x27;.<p>In general, it returns errors by printing a message rather then returning an error code or raising an exception. It also doesn&#x27;t hook into Python built-in methods like __len__.<p>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.