HW 11 Grading Guide


All the questions should use recursive solutions and should not use either side-effects (i.e., set!) or iteration. Deduct the bulk of the points for using either construct. Do not waste time looking through the student's code trying to understand it. If I ask you to look for something, such as the delay and force constructs in problem 7 or tail recursion in problem 3, then scan the student's solution and make sure it's there. Otherwise just come up with sample data for the indicated test cases and run their code against it.

  1. (15 points): It may be easier to eyeball this one rather than running it, because it's a one line function. Use your judgment in assigning partial credit

  2. (15 points): I don't care whether or not the function is tail-recursive.

    1. Deduct 1 point for not converting the result to a floating point number.
    2. Deduct 2 points for not returning a reasonable value, e.g., 0, for an empty list
    3. Make sure that a single element list works properly (deduct 2 points for not working properly)
    4. Use your judgment in awarding partial credit

  3. (15 points)
    1. Verify that the solution works on empty lists (the return value should be an empty list), one element lists, and arbitrary length lists (-2 points each for not working with empty lists and one element lists)
    2. Scan the solution and make sure that it really uses tail recursion. Deduct the full 15 points for not using tail recursion.
    3. Use your judgment in awarding partial credit

  4. (15 points): Things to check
    1. empty list
    2. single element list
    3. multi-element list

  5. (15 points): Don't waste time trying to figure out if it does not work properly. Things to check:

    1. empty lists
    2. one element lists
    3. arbitrary length lists
    4. lists in which none of the elements passes the filter
    5. lists in which all the elements pass the filter
    Each case should be 3 points but use your judgment.

  6. (15 points): Do not try to decipher the code. Check the following cases:

    1. (1 point) Empty tree (i.e., empty list)
    2. (2 points) Tree with single node (i.e., one element list)
    3. Trees that contain a subtree with a single child
    4. Trees that contain a subtree with an arbitrary number of children
    5. Have at least a couple cases where the two trees have the same set of leaves, but different structures
    The last three cases are 12 points. Use your judgment in awarding partial credit. Deduct the full 15 points for not using map and reduce/fold.

  7. (10 points): Make sure that they create two parts and that they use the delay and force constructs. Then run their printFib function and verify that it generates the first n fibonacci numbers correctly, where n is some number that you choose.