Write a group of generic static methods for examining and manipulating a collection of items via the

Question:

Write a group of generic static methods for examining and manipulating a collection of items via the collection’s iterator. For example, one of the methods might have this heading:

public static  E find( Iterator it, E target );

When the find method is activated, the iterator, it, is already in some collection. The method searches the collection via the iterator. If one of the collection’s elements is equal to the target (using the equals method), then a reference to that element is returned; if the target is never found in the range, then the null reference is returned (and the iterator is left at a position that is just after the target).

Discuss and design other methods for your toolkit that manipulate a collection. As a starting point, please use the linked-list methods from the previous chapter.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: