Algorithms and OOD (CSC 207 2013F) : EBoards

CSC207.01 2013F, Class 47: Hash Tables, Continued




Questions on the exam

For problem 3, is it acceptable if I ignore the implementation specs and, say make a decision to, say, remove the smallest element in the right subtree?

Major changes are not acceptable. For a change like this, I may run a different set of unit tests (since some of the unit tests are designed particularly for the implementation I specified.)

If we pass your unit tests, is that enough for correctess?

Yes, with the exception mentioned above.

For problem 3, how do the unit tests help me identify problems?

There are two kinds of problems that get identified: Those with the regular tests and those with the random tests. If you look at the call stack for the regular tests, youknow exactly what input caused it to fail, and so you can step through and see what's happening. (I usually write experiments.) For the random tests, you'll see a printout of the operations used to create the tree. Again, that gives you an opportunity to write an experiment that tells you what's happening.

_ I know you love invariants. How many are we required to write?_

None. But you'll find they help.

Questions on Hash Tables


Copyright (c) 2013 Samuel A. Rebelsky.

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.