Page 1 of 1

java language 2) Write a method, that searches for a key within an array and returns the index number of a key if the ke

Posted: Sun May 15, 2022 10:08 am
by answerhappygod
java language
2) Write a method, that searches for a key within an array and returns the index number of a key if the key is in the array, -1 otherwise. ( Use linear search algorithm that searches backwards from last index to the first index)
3) Write a method, that searches for a key within an array and returns the index number of a key if the key is in the array, -1 otherwise. ( Use binary search algorithm)