Question: please account for an empty list. array list methods are not allowed also 1 Sequence Finder (10 marks] In the provided Find, java file, complete
1 Sequence Finder (10 marks] In the provided Find, java file, complete the locateSequence method. For a given target sequence (non-empty array of integers), the method searches the input array (of integers) to find an occur- rence of the target sequence if it is present. If the sequence is present, the method returns the array index position of where it starts in the array. If the sequence is not present, the method returns -1. Consider the following array: 8 6 7 5 3 0 9 If we look for the sequence 7,5,3 in this array, the method should return 2. If we look for the sequence 9, it should return 6, and if we look for the sequence 3,0,9,1, it should return -1. If the sequence appears in the array more than once, the returned position should correspond to the last occurrence of the sequence. Note: The Find class is not meant to be a program. It is simply a class that has a static method that will be called from another class (Which is a program). You are free to add a main() method to test your code. We will not run your main() method (but be sure it doesn't have a compile error!)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
