Data structure and algorithm routines.