Data structure and algorithm design