Add a method boolean contains(Object obj) that checks whether our LinkedList implementation contains a given object. Implement

Question:

Add a method boolean contains(Object obj) that checks whether our LinkedList implementation contains a given object. Implement this method by directly traversing the links, not by using an iterator. Use the equals method to determine whether obj equals node.data for a given node.

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

Step by Step Answer:

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