Write a client program ClientSearching and in the main method: Call a method, SequenSearch() that performs sequential search. The method accepts two parameters: an array of integers (any order) and one integer. It returns the index of the one integer in the array if it is found, otherwise it returns -1. Print the original array, one integer being searched, and returned index in the main
Need help with this. Must be in java. Make the code unique and no plagerism.
- a. Write a client program ClientSearching and in the main method:
- Call a method, SequenSearch() that performs sequential search. The method accepts two parameters: an array of integers (any order) and one integer. It returns the index of the one integer in the array if it is found, otherwise it returns -1. Print the original array, one integer being searched, and returned index in the main
b. Call another method, BinarySearch() that takes two parameters: an array of sorted integers and one integer. The call should perform binary search and return the index of the integer in the array if found, otherwise return -1. Print the original array, one integer being searched, and returned index in the main
c.Call a third method, BinarySearchRecur() that performs binary search recursively. It should take 4 parameters: a sorted array of integers, start position (index) and end position(index) of the array, and the integer value to find. It should return the index of the element if found, if not then it should return -1. Print the original array, one integer being searched, and returned index in the main
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images