data struct and algorithm