Question: JAVA DATA STRUCTURES [ Chapter 5 Generic Programming ] Suppose that the variable head is a reference to the head node of a linked list
JAVA DATA STRUCTURES [ Chapter 5 Generic Programming ]
Suppose that the variable head is a reference to the head node of a linked list of objects. Each node has an instance variable called link (which is a reference to the next node) and another instance variable called data (which is an Object that's store in the node). Write a few lines of code to count the number of occurrences of a specific non-null target Object on the list. At the end of your code, a variable called answer should indicate how many times the target appears in the array. Use target.equals to test for equality.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
