The codes assigned to various leaf nodes are listed in the table given below:
CharacterFrequencyCodeCharacterFrequencyCode
Б (space)1800l11101000
o9010f11101000
a40110i2110101
w301110.2110110
g301111,2110111
e11100y411100
n71010u411101
r71011h81111
t71100
As expected, the most frequently occurring character called space (Б) has got the shortest code i.e.
‘00’. Similarly, the character ‘e’ has been assigned a shorter code i.e. 100. Obviously, the least frequently
occurring characters like l & f have been assigned the longest codes 1101000 and 1101001 respectively.
Let us now com
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.