implementation of common data structure and algorithm