data structure and algorithm implement