Question: class ThingArraySortedSetIterator This is an inner class inside the ThingSortedArraySet class and it is used to iterate over all elements in the collection. An

class ThingArraySortedSetIterator This is an inner class inside the ThingSortedArraySet class and

class ThingArraySortedSetIterator This is an inner class inside the ThingSortedArraySet class and it is used to iterate over all elements in the collection. An implementation of the list iterator is discussed in class and can be found on lecture-03-jan-28.ppx file on week-03-Jan28 folder on D2L. Basically, the header of your iterator class should be as follows: public class ThingSortedArraySetIterator implements Iterator You have to change of the rest of iterator class as necessary to reflect your Thing data type. You also must change your Thing SortedArraySet class to implement Iterable and add the iterator method that returns an iterator of type ThingArrayBagIterator. To test this part, write a for-each loop in the driver to iterate over all items in your collection.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Public class ThingSortedArraySet implements Iterable private thing data private int size public Thin... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!