I ran into an example in Computer Science Course.
suppose we use Hashing with chanining and use table of size m. the hash function map record with key k into k mod m slot. if we know the record keys is subset of {$i^2 | 1 \leq i \leq 100 $}, for which value of m cost of search is lower in worst case?
a) 11
b) 7
c) 9
d) 12
We observe: Using $m=7$ we have in the worst case a chain of length $29$, which means $28$ collisions.
We tabulate the cost of search in the worst case for the different $m$ values
\begin{array}{rc} m&max\\ \hline 7&29\\ 9&33\\ 11&\color{blue}{\mathbf{19}}\\ 12&34\\ \end{array}