I have an array of 64-bit integers of length $n$ and I want to find the frequency of each element in $\mathcal{O}(n)$? is that possible?
my idea was to use a hashmap but it seems to me that the adversary would always be able to find a pathological case.
adversary would always be able to find a pathological case
: you can use your own hash function: $h(x) = p \cdot x \pmod {m}$, where $p$ and $m$ are (large) prime numbers randomly selected at the beginning of the program. While adversarial inputs exist (e.g. $0$, $m$, $2m$, ...), the adversary doesn't know them, since they don't know $p$ and $m$. $\endgroup$