3 ms·
"we have ten weeks to take people who may have never programmed by typing text into an editor and teach them enough CS and programming that they can implement t
by hnriot 12y ago
"we have ten weeks to take people who may have never programmed by typing text into an editor and teach them enough CS and programming that they can implement their own hashmap in Python"
that seems utterly pointless to me.
- Goladus 12y agoMaybe, I'd have to see the actual class. Remember that if this is a 4-year curriculum, they may eventually be expected to write code for a hashmap in C or some other low-level language as part of a data structures or algorithms class. And often, a class like that will spend time on analysis and algorithm design tradeoffs. The best way to understand why accessing a hashmap can be done in O(1) time is to actually code one for yourself. This may simply be a preview.
- candeira 12y ago> they may eventually be expected to write code for a hashmap in C or some other low-level language as part of a data structures or algorithms class (...) > This may simply be a preview. No, this is it as far as the core units go. This is the first course on data structures and algorithms. There is a second year course that deals with further data structures and algorithms: we teach amortized performance, proofs by induction, some randomized data structures (skip lists and maybe another), different tree-based structures (I remember red-black trees and patricia trees), some graph search algorithms and a bit more than I forget now. And currently we are doing it in Python for the first unit, and in any language that the student and their tutor can agree on for the second unit. Remember: these are just class exercises, not real implementations. Of course nobody is going to write actual functioning data structures in Python[1] and expect them to be usable for general purpose programming[2]. That would be daft! [1] https://bitbucket.org/pypy/pypy/src/8920909d084ec0d42535b955350de5ad32aa01d3/pypy/objspace/std/dictmultiobject.py?at=default https://bitbucket.org/pypy/pypy/src/8920909d084ec0d42535b955... [2] http://pypy.readthedocs.org/en/latest/ http://pypy.readthedocs.org/en/latest/
- pwang 12y ago> Of course nobody is going to write actual functioning data structures in Python Or even http://toolz.readthedocs.org/en/latest/ http://toolz.readthedocs.org/en/latest/ Daft, indeed! :-)