This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: defines the list node that contains an element • SparseNumericIterator defines an iterator for the vector of elements • SparseNumericVector defines the vector using the above supporting classes. All of the code in the first 3 classes is provided. The only class you need to change and submit is SparseNumericVector . Here you need only add the code for 3 of the methods: • add : add an element to the vector • remove : remove an element from the vector • project : take the inner (dot) product of the vector with another vector passed as an argument. This method should run in O(m+n) time , where m and n are the number of non-zero elements in each vector. Here is a test program testSparseNumericVector that provides a few test cases. You should, however, test your program using a broader range of test cases. Pay particular attention to boundary conditions....
View Full Document
- Summer '10
- Subroutine, Vector Motors, Array data structure