Grading
Annotations
Packages
Exporting and Submitting
Much of the grading for this course is automated. Because of this, you must be careful to follow the instructions exactly. Filenames, directory names, and annotations should all be written precisely to avoid confusion by the automated system. Submission should be done according to the instructions. Mistakes mean extra work for the grader and instructors, and will result in undebatable loss of points.
Start early and test often. Attempting to write an entire program without testing is asking for trouble. When you
are done with a data structure or class, create a
public static void main(String[] args)
within the class that creates
instances, tests methods, and prints the results.
Each class should start with a comment block that includes:
To use automation for this course, we require incorporating annotations to describe the code being
written. For this we have five annotation interfaces.
TimeComplexity
, TimeComplexityAverage
,
TimeComplexityAmmortized
, and TimeComplexityExpected
.
Each of your method should have at least one of the Time Complexity annotations for
each method. Valid example values for the complexity are: "O(1)", "O(n)",
"O(n^2)", "O(n^3)", "O(lg n)", "O(n lg n)", "O(n^2 lg n)", "O(2^n)", "O(n+m)",
and "O(?)", though some may be added later. The "O(?)" should only be
used when complexity isn't relevant.
To use the annotations, simply add the correct annotation above the method or class name:
@TimeComplexity("O(n)")
METHOD_DECLARATION
Be sure that each of your annotations is exactly the same as one of the annotations listed. Note that the notation is a capital 'o', not a zero.
Each non-trivial method should include special comment blocks that begin with the letters TCJ" that justify the time cost (TCJ=Time Cost Justification)
@TimeComplexity("O(n)")
@Override
public E remove(int i) throws IndexOutOfBoundsException {
/* TCJ
* all the elements starting from index i+1 to the last one have to shift to its left.
* The number of shifting is n-i. At worst case when i=0, there are n shifts. The worst case of remove method is O(n)
* At best case when i=size-1, there is 1 shifts. The best case is O(1)
*/
checkIndex(i,size-1);
E old = data[i];
//set element from [i .. size-2] to be the next one on its right.
for (int k = i; k <= size-2; k++) {
data[k]=data[k+1];
}
size --;
return old;
}
The book uses a number of interfaces and exception classes that you will need. These are included in a package
called net
which are included in each assignment. Do not modify the package in any way, or put it inside
another package. This is important for the automated grading.
You will be writing a number of data structures through this course
and annotating them. The structure for the data structure
implementations, and annotation definitions will be in a package called
cs2321
.
These will be provided for you in the assignment.
You may add new classes to the cs2321 package when necessary, however you should use the provided files as much as possible. (I.e. don't add a new class unless there's a reason why a seperate class is a better design). You may NOT add other packages or create sub-packages within cs2321.
You must submit a program without errors. You may make multiple submits - the grader will grade the last program submitted before the due date. (Note: Anything submitted after the "official due date" and before the "resubmit date" will be considered late and will have a 10 point penalty (1 letter grade).
You must export your project to an archive file from Eclipse - DO NOT simply "zip" it up from your file browser. To export your file:
After you have exported your project to progN.zip (where N is the number/letter of the assignment), use the command submit
to turn your program in.
(Note: this is only available on CS lab machines. If you are not working in
a lab, you will need to either come to campus or transfer your file and
remotely login to complete your submission)