0
Hey, I was wondering if anyone could help me with a jave program exercise from the book "Big Jave Late Object"
Here it is: P.16.10 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. Also please include comments in the program and a tester for the program. Thank you.
4 Answers
+ 2
Do you have code where you are stuck?
Have you implemented the linked list? And how did you implement it. If you dont show us code we cant really help you.
The only thing i can say is that you need to traverse the links to the next node to find the searched object.
+ 2
The code looks good on the first glimpse. The only suggestion i wannt to give you is to format the code with the right intendation. Because than the code is more readable.
When i have time i will further look into the links and if they are set up correct. And then look into traversing those links.
0
Here's the code LinkedList:
https://code.sololearn.com/cfGdLI7qxwZd/?ref=app
0
Thank you !