I have a set of uint32 integers, there may be millions of items in the set. 50-70% of them are consecutive, but in input stream they appear in unpredictable ord
uint32
Rather than a 'comparison' based storage/retrieval ( which will always be O(log(n)) ), You need to work on 'radix' based storage/retrieval .
In other words .. extract nibbles from the uint32, and make a trie ..