So I have written the following program with methods: inputArray, selectionSort, binarySearch, and printArray. I am currently working on the main method and am struggling with what to do.
"Write the main method to invoke inputArray, selectionSort, and printArray methods. Next, your main method should ask the user to input a double value to use as a search key and then invoke the binarySearch method. Finally, the main method should print out the location of the key if it is in the list and an appropriate message if the key is not in the list."
How can I print the the index value from the binary search?
binarySearchreturn if the key is not found? Therein is the answer.int found = binarySearch(array1, key);