What is the most compact (space efficient) method of storing an array of distinct integers?
If your integers have small difference between them you can use a bitset with an offset. In this way if the difference between the largest and the smallest is n you need n bits + the size of the offset in bits. If your integer set is sparse you can use a sparse bitset implementation like Roaring bitmap .