Huffman coding starts with exact symbol counts.
Start with counts
Huffman coding starts with symbol counts. More common symbols should get shorter names.
counts first
The counts are pinned
Here A appears 5 times, B appears 2 times, and C and D each appear 1 time.
A:5,B:2,C:1,D:1
A should be short
A has the largest count, so the final code should not spend many bits on A.
larger count means shorter code
Summary
The table is not a hand-written answer. It recomputes the code from these counts and the deterministic tie rule.
deterministic recompute