CSCE 235

Homework Assignment 11

Assigned:  April 17, 2009

Due: 12:30 a.m. April 24, 2009

 (Homework 5 minutes late will not be accepted)

 

1.   (10 points) Suppose that twelve teams (seeded 1 through 12) qualify for the playoffs in a local softball league.  In the first round of playoffs, the top four teams get a bye—they do not play.  In the first round, Series A pits team # 8 against #9; Series B pits team #7 against #10; Series C pits team #6 against 11; and Series D pits team #5 against #12.  In the second round, Series E pits team #1 against the winner of Series A; Series F pits team #2 against the winner of Series B; Series G pits team #3 against the winner of Series C; Series H pits team #4 against the winner of Series D.  In the third round, the winners of Series E and Series H play each other in Series I; the winners of Series F and Series G play each other in Series J.  Finally, the winners of Series I and Series J play in the championship series.  Draw a tree which summarizes the playoff structure in this league.

 

2.   (10 points) Draw the graphs of all nonisomorphic unlabeled trees with five vertices.

 

3.   (15 points) Draw all the eight spanning trees of the following graph:

 

 

4.   (30 points) Build a binary search tree for the words Kansas, Texas, Iowa, Oklahoma, Nebraska, Missouri, and Colorado, assuming that these words are added one at a time to the binary search tree given the above order.  The left child of a node is alphabetically ahead of the right child.  Show the binary search tree.  How many comparisons are needed to locate or to add each of the following words in the search tree, starting fresh each time?  (a) California, (b) Florida, (c) Ohio, (d) Missouri, and (e) Wyoming.

5.   (20 points) Given the following tree,

(a)    (5 points) Give the list of names using pre-order traversal.

(b)    (5 points) Give the list of names using in-order traversal.

(c)    (5 points) Give the list of names using post-order traversal.

(d)   (5 points) This is an m-ary tree.  What is m?

 

Problems based on (Rosen 2003, Goodaire and Parmenter 2002).