If your group is joined by a fourth person, split into two groups of two.
After pasting:https://shell.cec.wustl.edu:8443/cse131_fl11/svn/studio9-ZZZZZZ
In lecture this week, we looked at a Buffer<T> ADT. We then examined how Buffer<T> could support the Stack<T> and Queue<T> ADTs. In studio this week, you will investigate the Circular List, developing a parametric implementation that can also support the Stack<T> and Queue<T> ADTs.The investigation should conclude with your ability to explain the qualitative difference in design and implementation between a singly, doubly, and circularly linked list. The quiz on this module will emphasize those distinctions, as follows:
- What are the respective lists' advantages and disadvantages?
- What implementation considerations were important to a given implementation as compared with the others?
All the work below is to be done in your group's studio9 package space.
ListItem is a parametric type: an instantiation of ListItem requires specification of an actual type for the type variable T. Discuss why parameterized types are useful. What role does the type variable play in the definition of the ListItem class?
The studio prep material is going to be very helpful in reasoning about how to set up this ADT and maintain its structure with insertion and deletion. Have the last few pages of the notes handy as you work.
ListItem<T> back;Although it should be private, do not make it private! We will want to access it for testing.
If you are not sure what back does, take a look at the pictures on page 6 of the studio prep material .
It is here, and not in ListItem, that you should create a String that shows the whole list. Your method should be as simple as possible. Try to articulate the fewest number of special cases (should be just one special case and then general treatment for all else).
Check the output of the test in the console window to make sure your toString() is working properly.
You should now pass the testRemoveFirst test.
When you done with this studio, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches