CS360 Midterm -- October 18, 1999. Question 1

Your job is to write the procedure print_tree() which has the following syntax:
typedef struct {
  int type;
  Jval fn;
} PTstruct;

void print_tree(JRB t);
Print_tree() receives as input a red-black tree. This tree holds names and is in the following format: The key field of each node is a character string holding a last name. The val field is a pointer to a PTstruct. PTstruct's come in two flavors. If type is zero, then fn is a character string containing a first name. If type is one, then fn is another red-black tree containing first names in its key fields.

Your job is to print out all names in the tree alphabetically by last name. If there are multiple first names for a single last name, then those names must be printed alphabetically by first name. (In other words, just print the names in the order in which they appear in the tree.).