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.

26th Apr 2019, 2:07 AM
Junior
Junior - avatar
4 odpowiedzi
+ 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.
26th Apr 2019, 4:47 AM
Dragonxiv
Dragonxiv - avatar
+ 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.
26th Apr 2019, 7:11 AM
Dragonxiv
Dragonxiv - avatar
26th Apr 2019, 6:09 AM
Junior
Junior - avatar
0
Thank you !
26th Apr 2019, 9:15 AM
Junior
Junior - avatar