|
Code Listing by Alessandro Presta |
---|
|
The purpose of this recipe is to look at algorithmic graph theory from an object-oriented perspective.
A graph is built on top of a dictionary indexed by its vertices, each item being the set of neighbours of the key vertex. This ensures that iterating through the neighbours of a vertex is still efficient in sparse graphs (as with adjacency lists) while at the same time checking for adjacency is expected constant-time (as with...
Provides a data structure for a queue of integers whose get() method returns the median element. The interface is similar to the standard Queue module, with an added method top() to retrieve the median without removing it.
Implements a data structure for sets of natural numbers, represented by a single integer. The interface is similar to the built-in structure 'set'.
A simple decorator that helps define abstract methods: when such a method is called, an appropriate exception is raised. |
|
|
All files and free downloads are copyright of their respective owners. We do not provide any hacked, cracked, illegal, pirated version of scripts, codes, components downloads. All files are downloaded from the publishers website, our file servers or download mirrors. Always Virus check files downloaded from the web specially zip, rar, exe, trial, full versions etc. Download links from rapidshare, depositfiles, megaupload etc not published.