sp nl figure huffman' algorithm after the second merge sp nl figure huffman' algorithm after the third merge this is shown in figure the third step merges and acreating with weight figure shows the result of this operation after the third merge is completedthe two trees of lowest weight are the single-node trees representing and the blank space figure shows how these trees are merged into the new tree with root the fifth step is to merge the trees with roots and since these trees have the two smallest weights the result of this step is shown in figure finallythe optimal treewhich was shown in figure is obtained by merging the two remaining trees figure shows this optimal treewith root we will sketch the ideas involved in proving that huffman' algorithm yields an optimal codewe will leave the details as an exercise firstit is not hard to show by contradiction that the tree must be fullsince we have already seen how tree that is not full is improved sp nl figure huffman' algorithm after the fourth merge