Comp202: Principles of Object-Oriented Programming II
Fall 2007 -- Lecture #11: Binary Trees and Process Flow Analysis   


First let's take a quick review of Binary Trees.

Up until now, we've really only ever put relatively "dumb" data into our data structures.   What if we put something with some more intelligence into our tree here?    For instance, suppose we filled our tree with abstract entities, in particular, entities that had their own visitors to determine variant behaviors that depended on the specific concrete instance encountered.

So how do we process a tree, which is an abstractly defined entity, that is filled with abstractly defined entities?   Life definitely gets a bit more complicated here.   How can we deal with such a complex system in an organized, structured manner that will bring forth order from the chaos? 

"Process Flow Analysis" is essentially a strict delegation model approach to solving complex problems.   In a nutshell, at any given point, one does what one can with the information at hand.   If the information is insufficient to perform the task, delegate forward, collecting information until the course of action can be determined unequivocally.   This really isn't any different than the way we've always analyzed algorithms, just more formalized.   The process is simpler than it sounds and is best illustrated with an example.  

The Tournament Tree simulates a "single elimination" tournament, as one might have in a tennis or football tournament.   The tournament itself is a binary tree, holding the "players" who start off at the leaves of the tree.  As each round of the tournament is played, the one of the players from a child tree advances upwards into the next higher node of the tree until one team arrives the very top and is crowned the winner.

The Tournament Tree project is the next homework assignment. 

Go to the Tournament Tree Project.

 

 

 


Last Revised Thursday, 03-Jun-2010 09:52:33 CDT

©2007 Stephen Wong and Dung Nguyen