lets say i have numbers from 1-10Million (customer ids). each single number is associated with 1 of 3 possible values - A,B,C.
i know that very large adjacent regions of about 1000 elements are in the same category.
what is a data structure that allows me to save the link between number range and category in a memory-efficient way?
also, is there a java implementation of an interval-tree, which was suggested in an answer.