CSCI 1302 Software Development Summer 2008 Programming Project 3 Questions and Answers Q1. for indexOf() and lastIndexOf(), they both have the exact same instructions...did you mean to return the largest location for the lastindexof() method? A1. Yes, thanks for noticing. It is now corrected in the project description. Q2. for the removeFirst() method, do we want to just remove the element and return it, or do we also shift the rest of array to the left to fill the empty index that will result from removing the first element? A2. Because of the ringbuffer implementation, the only actual (as opposed to logical) shifting should be when performing an add(i, elem) or a remove(obj) since those will in general occur in the middle of the logical index range. An operation on either end, such as removeFirst( ), does not require actual shifting. So return the first element and then remove it. You'll shift the logical indices by moving the starting index (logical index 0) up one in actual index; nothing else will need to be moved or shifted. Q3. I'm a little confused about the toString method...is it just going to return the elements in the list separated by a space? A3. No, on separate lines ('/n' is the newline character). Q4. What is the RingList(RingListotherRingList)? I know it copies an array with the same elements and capacity into a new list, but what does the stuff inside the parentheses mean exactly? How do i type this in my test file ... (like an example of how this would be used)? A4. If you already had some list otherList of type RingList, then in client code you could create a copy with the constructor, as follows RingList newlist; newlist = new RingList( otherlist ); The syntax is a "bounded wildcard"; see Subsection 4.7.3 in Gray's book for an explanation. You don't need the explanation in order to do the project, however. Just use the signature as given. What it will do is allow the above 2 lines to work if otherlist is of type RingList where T is a class which extends E.