Implementation of data structure and algorithm