|
C M S C 2 1 4 C o m p u t e r S c i e n c e I I F a l l 2 0 0 3 |
Yes. Change your P4 so that in Decoder, reader() calls insert().
Then
you won't have problems with my tests.
Yes, you aren't the only one. Try these things:
In Decoder, printCode() is printing the 4-digit codes that are read
into a string. printPlain() is printing the plaintext translation after
decode() has be executed.
Yes, but I am not changing any .h files at this point so we will
leave it as is.
You can get main.cpp from the posting account or click on the link
from the checklist.
Since a BST is in order (alphabetically) with an inorder traversal, you can assume that once the iterator is pointing to a node, say "we", it will go to the node that is its successor ALPHABETICALLY when you do ++.
Similarly, when you do --, walk to the node alphbetically preceding the node you are on.
Do not throw exceptions when the iterator is ON the first
(smallest) node in the tree or when it is on the last (largest) node in
the tree. Throw and exception if it walks off the tree in either direction
(walks left if it is on the smallest node or walks right if it is on the
biggest node.)
Yes, such as insert() in Encoder.h:
// checks to ensure that the text is in
the dictionary
// before putting it into the dll
which we all realize is incorrect. However, it seems that changing
the .h files at this point to correct a few comments is not
reasonable. So let's assume we go with the comments and meaning of
project 3 except for new additions such as templatizing,
inheritance, BstIterator, and the few changes in the
prototypes.
Yes, I have rerun this with a blank fixer and it is fine
now.
In the constructor it is set to NULL. It is not really initialized
until there is an non-empty tree that it can be associated with. Then
begin() (which sets the iterator to the smallest node in the tree) or
end() which sets the iterator to the largest node in the tree) can be
called.
The EXACT .h files for Bst, Bstplus and Encoder (with
correct templatizing) are now posted in P4. You should
use these files so that they will diff with ours.
Bst does not contain a data element that needs to be generic, BUT
it contains a templatized class, so Bst needs to be templatized. Do
not substitute <Pair> in there. Use the generic <T>. So
to be VERY
CLEAR, the following classes have a template prefix in them: Bst,
Bstplus, BstIterator, ModNode, Node, TNode and Encoder.
My mistake! that should have said a constructor that takes a pair
(but it really takes a templatized object). I changed
the web page to be correct.
These are MY private functions that were not supposed to be
released to you. But the good news is you realize that you should have a
function that will be able to find the preceeding or succeeding node so
you can call them from ++, -- and any other math functions in
BstIterator. I have put comments saying you do not have to implement
these functions. You might wnat to implement them anyway and change at
least one ModNode * to point to either the root of some tree or a
BstIterator.
Yes! Look under SampleI/O on the project 4 web page. There is a link
including some of my code and a hint on how to get around extra blanks.
Project #4 is due by 11pm on Tuesday, November 18th, 2003.
Note:
If this project is turned in after 2 days late and passes primary.
input, it will receive
a grade of 10 (out of 100) points. This project
must be successfully submitted on
or before Dec 8, 2003 at 11PM in
order to pass this course.
|
See the class syllabus for policies concerning email Last Modified: Fri Oct 31, 2003 |
|
|
|
|
|