However, it is possible to rebuild the tree in place. First note that when reading values we refer only to entries below the leaf node, whereas when updating, we modify only those above the leaf node. Therefore, by scanning down the table reading and updating, we will always read only the old, unmodified values. The loop to halve all frequencies just reads the frequency for an index and subtracts half that value from the same index. It is shown in Figure 9.
基于1个网页-相关网页
应用推荐