Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Algorithms and Data Structures in Think Python

 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im looking to learn Data Structures and their implementation . Does Think Python provide any sort of insight into them?
Thanks!
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might be interested in "Python Algorithms" by Magnus Lie Hetland. It doesn't cover data structures.
 
Allen Downey
Author
Greenhorn
Posts: 28
Java Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Teaching data structures and algorithms in Python is funny, because most standard data structures are either built into the language or available in libraries. So it's hard to motivate students to reimplement them.

On the other hand, Python is an excellent language for implementing algorithms: if you take the pseudocode from a book like Cormen, Leiserson and Rivest, you can usually translate it into Python with very little effort.

In Think Python Appendix B I cover basic analysis of algorithms, and as an example, I write an implementation of a hash table in Python. On one hand, that's a silly thing to do, because Python dictionaries are hashtables. On the other hand, the code is short and readable and (I think) makes it easy to understand how/why hashtables work.

Allen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic