Prob 2: Several people used as the condition in the while loop: P->next != NULL. This would result in not adding the data section in the last element of the list.
Prob 3: If it is known that a deque, or a stack, or a queue will only have multiple copies of a single symbol put into it, then the implementation problem reduces to that of implementing an integer "counter" to record accurately how many instances are in the data structure at any time.
Prob 4: Some people did not remember the correct definition of "depth" and "degree."
Prob 5: Many people showed the binary trees with EXACTLY 3 nodes, but ignored those trees with fewer nodes. I asked for ALL trees with AT MOST 3 nodes (which includes trees with 2, 1, and 0 nodes).
Technically, a tree with no nodes is still a tree.
Prob 6: The best way to handle this problem is to compute the "pseudo height" of each node starting at the leaves and working back to the root.
The leaves have "pseudo-height" of 1.
The internal nodes have "pseudo-height" of 2.
For some sort of partial credit, it helps if there were some numbers attached to the nodes on the tree. In most cases, only an (incorrect) answer was circled with no indication of how that answer was obtained.
Prob 7: A gets the value of the list (6 (5 4 3) 2 1) which has 4 elements, the second element being itself a list of 3 elements.
Thus, (CDR A) is the list ((5 4 3) 2 1).
Thus (CADR A) which equals (CAR (CDR A)) is the first element of (CDR A) which, in this case, is the list (5 4 3). (Remember that there is a difference between "5 4 3" and "(5 4 3)." The second is a list, but the first is three unconnected atoms.)
Prob 8: A few people, for some reason, rearranged the order of the atoms that were (sub-)parts of the list. The major problem dealt with the correct number and type of parentheses in the correct places.
Prob. 9: In Essentials Vol II, pg 112, there is an example of using a tree to diagram an arithmetic expression. A key rule (in parentheses before the diagram) is that the INTERIOR NODES ARE ALWAYS OPERATORS and arguments/operands (i.e., variables or numbers) are found only on the leaves.
Prob. 10: Most errors had to do with incorrect arithmetic computations.
x x x x x x x x x x x x x x x x x 40 50 60 70
This page is maintained by Dennis C. Smolarski, S.J.
dsmolarski@math.scu.edu
© Copyright 2000 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 19 February 2000.