Question: Solve Exercise P16.4 recursively, by calling a recursive helper method private static boolean contains(Node start, Object obj) If start is null, then it cant
Solve Exercise •• P16.4 recursively, by calling a recursive helper method private static boolean contains(Node start, Object obj) If start is null, then it can’t contain the object. Otherwise, check start.data before recursively moving on to start.next.
Data from exercise P16.4
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.
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
Given the data from exercise P164 and the exercise question itself we need to solve it recursively T... View full answer
Get step-by-step solutions from verified subject matter experts
