Many times a problem can be greatly simplified if there is a limit to the range of data that enters the system. For example, for color channels in a normal 16 million color display the range is only 0 to 255 for each channel, so of course that means each channel can be stored in a single byte. If it wasnt like that, it could take two or more bytes just to store that one channel, or channels would have to share bytes and that makes the whole thing harder to implement.
So i just have to ask if there is a limit to the range of data that will be accepted as input. If the data only appears as integers from 1 to 100 for example, we can probably do this in a very nearly N time period without too much trouble even with a HUGE data set of over 2^32 items.