Data structure and algorithms in Python