CS 4320 (Yang) Summer 2003
Individual homework #1
Due: July 8, 2003, 10AM (via digital drop box)


Note:
This assignment is to be done on your own.
In particular, it would be wrong to show your assignment to a fellow student.
  1. Consider the following problem:
    Write a program that uses a binary tree to store and lookup strings. The program should repeatedly offer the user the choice of the commands "i" to insert a new string, "f" to find a string, and "q" to quit the program.

    There is a separate executable testTree.exe wrapped in a zip file. Please find 3 defects related to the program execution. There are defects which involve simply incorrect behavior. There are also defects which technically do not violate the requirements, but which are in some way inappropriate.

    By "program execution", I mean that we are only looking at what the program does. You are not to consider things like whether the program should have supported a GUI, whether the requirements are complete, or whether the program even makes sense. While these are ordinarily legitimate concerns, your concern on this problem is with the program you have.

  2. Now consider the following source code for the insert function for a binary tree of integers. [Obviously, you pick either the C++ version or the Java version.] Specifying exact values, describe minimal (use as few cases as possible) sets of test cases to provide:

    The binaryTreeNode class supports

    If there is overlap in your answers, that is fine -- you can number the testcases and refer to them accordingly.
    C++ version
    Java version