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
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.
Step by Step Solution
3.42 Rating (161 Votes )
There are 3 Steps involved in it
To implement a containsObject obj method in a LinkedList we first need to understand what a LinkedList is A LinkedList is a linear data structure wher... View full answer
Get step-by-step solutions from verified subject matter experts
