This is quite related to the problem of sorting a million 32 bit integers using only 2M of RAM (and no disk). It can be done.
I got a worst case of exactly 2 MB (1.907 MiB) (all deltas being 4294, so the list is 0, 4294, 8588...), but maybe it's possible to get better than that.
It would be uber slow though, probably n^2.
(edit: better link)
For (I=0; I<1<<31; I++) For (J=0; J<1e6; J++) If (input[J]==I) print(I);
Shoddy runtime, but hey...
Or more efficient, dynamically construct an implicit trie/heap type thing, where each leaf is the count of times that int appears (and the int itself is encoded in the location)
That feels really, really handwavy but promising?
You're right, that does sound impossible. :O
https://en.wikipedia.org/wiki/Sorting_algorithm#Comparison_o...