I am looking at the below Huffman tree, the corresponding frequency table and the subtotal table. That table calculates the subtotal bits. I want to know how to count the subtotal bits.
In the first row of the subtotal table, code 0 maps to 15. I understand that because A has a count of 15. But why code 100 maps to 21? 100 represents the node B and B has a count of 7. I would think that for 100 we should calculate 7 + 15 = 22, but the table has 21. Why?