Question: This method cannot use a helper method. Add a new method with the following header: public static int lastIndexOf(StringNode str, charch) This method must use

 This method cannot use a helper method. Add a new method

This method cannot use a helper method.

Add a new method with the following header: public static int lastIndexOf(StringNode str, charch) This method must use recursion to find and return the index of the last occurrence of the character ch in the string str, or -1 if ch does not appear in str. For example: = > StringNode s4 StringNode.convert("singing"); > StringNode.lastIndexOf(s4, 'n') 5 > StringNode.lastIndexOf(s4, 'i') 4 > StringNode.lastIndexOf(s4, 'x') -1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!