Questions on Using Python to Teach Data Structures and Algorithms



Hello,

I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure appreciate it:
1. What exactly is a Python list? If one writes a[n], then is the complexity Theta(n)? If this is O(1), then why was the name "list" chosen? If this is indeed Theta(n), then what alternative should be used? (array does not seem suited for teaching purposes.)
2. Suppose I have some file example.py, and I'd like to incorporate it **into** part of an HTML page with nice syntax highlighting and all the shebang. Is there an easy way to do so?
(Sorry, but any Google query involving "Python" and "HTML" (with any other additional terms) led to Python HTML processing libraries.)
3. Are there any useful links for Python/DSA education? I found "Data Structures and Algorithms with Object Oriented Design Patterns" (http://www.brpreiss.com/books/opus7/html/book.html). It is a fine book, but it is unsuitable: my students are electrical-engineers, and barely know how to program; teaching them DSA, python, **and** stuff like the visitor pattern seems impossible.

Python is such a cool language - I'm really hoping the students will enjoy it as much as I do. Once again, many thanks for helping out with this.

Thanks,

Efrat
.



Relevant Pages

  • Re: Questions on Using Python to Teach Data Structures and Algorithms
    ... Using Python to teach data structures and algorithms to ... I think Python is only partially fit for your purpose. ... One of the basic data structures is the chained list, ...
    (comp.lang.python)
  • Re: Questions on Using Python to Teach Data Structures and Algorithms
    ... use Python? ... good) books that used Pascal for this topic. ... "Data Structures and Algorithms with Object Oriented Design Patterns" ...
    (comp.lang.python)
  • Re: Ordering python sets
    ... As Python becomes accepted for more and more "serious" projects some ... SortedSet, SortedDict: can be based on red-black trees. ... I use all those data structures in Python programs, plus some more, ... A problem with the Chain data structure is how to represent iterators ...
    (comp.lang.python)
  • Re: variable question
    ... tutoring some kids about basics of programming using python. ... order data structures. ... The important thing is really that Python's approach of references is ...
    (comp.lang.python)
  • Re: Newbie completely confused
    ... Your program uses quite a bit of memory. ... And really, reading 30MB files should not be such a problem, right? ... 'del LINES' deletes the lines that are read from the file, but not all of your data structures that you created out of them. ... The python code loads a module written in C++ and some of the member variables actually point to C++ objects created dynamically, so one actually has to call their destructors before unbinding the python var. ...
    (comp.lang.python)