Assignments | Class Photo | Course Home | Documentation | Lab Hours/Tutoring | Schedule | Submit

Saint Louis University

Computer Science 180
Data Structures

Michael Goldwasser

Spring 2012

Dept. of Math & Computer Science

Homework Assignment 05

Trees

Contents:


Overview

Topic: Trees
Related Reading: Ch. 7 and skim Ch. 12.4. Most relevant for these questions will be 7.2.2, 7.2.3, and 7.3.6.
Due: Friday, 18 April 2012, 10:00am


Collaboration Policy

For this assignment, you must work individually.

Please make sure you adhere to the policies on academic integrity in this regard.


Problems to be Submitted (20 points)

  1. (5 points)

    For the tree in Figure 7.11 (on page 285), what order will nodes be visited during a postorder traversal?

  2. (5 points)

    Draw a (proper) binary tree T such that simultaneously,

  3. (10 points)

    The following binary string represents an encoded message using the format described in the upcoming decode programming assignment (for the sake of typesetting, we are breaking up the display to have 24 bits per line, but you should assume they are contiguous).

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

    Decode this message by hand and submit a picture of the Huffman tree as well as the decoded message.


Extra Credit

  1. (2 points)

    Creativity Exercise C-7.18 on page 315 of the text.


Michael Goldwasser
CSCI 180, Spring 2012
Last modified: Tuesday, 10 April 2012
Assignments | Class Photo | Course Home | Documentation | Lab Hours/Tutoring | Schedule | Submit