Data structure implementations in python