Homework Solution

Trees

Problems to be Submitted (20 points)

  1. (5 points)

    3, 1, +, 3, x, 9, 5, -, 2, +, /, 3, 7, 4, -, x, 6, +, -

  2. (5 points)

  3. (10 points)

    The encoded message is

    congratulations. get coding.

    The tree appears as follows:

    Here is a color-coded view of the original input. For the first portion, the black digits represent the internal and external nodes, with the red sections the 9-bit data for each external node. The second portion contains the coded message, alternating between blue and black at each character break.

    000100111010010011011100
    100110011110011011110000
    100110010010011011001001
    100001010011010011000100
    000001001100011100010111
    000110000000010011001010
    100111010101001110010100
    111001111000110010101111
    101001000111101000110010
    001010011001111111110110
    110101110100010111100011
    100001010001010110111100
          

Last modified: Wednesday, 08 April 2009