Python implementation of some algorithmic problems