Class Photo | Course Home | Homework | Programming | Schedule & Lecture Notes | Submit

Saint Louis University

Computer Science 220
Computer Science II
Michael Goldwasser

Fall 2004

Dept. of Math & Computer Science

Homework Assignment 06

Trees

Contents:


Overview

Topic: Trees
Related Reading: Ch. 6.1-6.4 of the text, except 6.3.5, 6.4.3 and 6.4.4. Most relevant for these questions will be 6.2.3, 6.2.4 and 6.3.4.
Due: 9:30am Thursday, 2 December 2004

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


Practice Problems


Problems to be Submitted (20 points)

  1. (5 points)

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

  2. (5 points)

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

  3. (5 points)

    Let T be a general ordered tree with more than one node. Is it possible that the preorder traversal of T visits nodes in the same order as the postorder traversal of T?

    If so, give an example; if not, argue why this cannot occur.

  4. (5 points)

    Let T be a general ordered tree with more than one node. Is it possible that the preorder traversal of T visits nodes in the reverse order as the postorder traversal of T?

    If so, give an example; if not, argue why this cannot occur.


Extra Credit

  1. (2 points)

    Creativity Exercise C-6.12 of the text.


CSA-220, Fall 2004
Michael Goldwasser
goldwamh at our university domain.

Last modified: Sunday, 21 November 2004
Class Photo | Course Home | Homework | Programming | Schedule & Lecture Notes | Submit