learning algorithm and data structure in python