When is Huffman code the most unoptimal?
There are several definitions of &quot;unoptimal&quot;.
As vonbrand noted, Huffman coding falls back to binary encoding if all frequencies are equal.
For longest code length, this happens if the frequencies are Fibonacci numbers.
For worst compression rate compared to the entropy, this happens with an alphabet of two symbols where $p_0 = \varepsilon$ and $p_1 = 1-\varepsilon$. The Shannon entropy approaches $0$ bits per symbol as $\varepsilon \rightarrow 0$, but any Huffman code requires $1$ bit per symbol.
For size of the Huffman tree, there is no &quot;worst case&quot;, because the size is the same no matter what the frequencies are. For an alphabet of $n$ symbols, the Huffman tree must have $n$ leaves and $n-1$ branches.