Code two methods, findFirst and findLast , each method takes two arguments, the first argument is an
Fantastic news! We've Found the answer you've been seeking!
Question:
Code two methods, findFirst and findLast, each method takes two arguments, the first argument is an integer array, the second argument is an integer value, call it key.
findFirst returns the location of the first occurrence of key in the array. -1 if not found.
findLast returns the location of the last occurrence of key in the array. -1 if not found.
Now, write a main method to test both.
Submit the .java file
Related Book For
Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe
Posted Date: