[Solved]7 6 Points Friend Suggests Cutting Dividing Array Half Works Well Binary Search Cutting Th Q37277672

7. (6 points) A friend suggests that if cutting a dividing array in half works well for binary search, then cutting into three parts may work better. Instead of checking the midpoint of the range, check the locations at one third and at two thirds of the range. If not found then repeat the search on the third of the range that may contain the key value. Try to write this function, trinarySearch, to search an array of integers for a key value. Test your function by creating a sorted array of even integers in the range 0 to 1000 (inclusive range) and searching for the keys 88, 888, 515, 540, -2, 2000, 1, 0, and 1000. For each search, print out the search key and the returned index from vour search function Show transcribed image text 7. (6 points) A friend suggests that if cutting a dividing array in half works well for binary search, then cutting into three parts may work better. Instead of checking the midpoint of the range, check the locations at one third and at two thirds of the range. If not found then repeat the search on the third of the range that may contain the key value. Try to write this function, trinarySearch, to search an array of integers for a key value. Test your function by creating a sorted array of even integers in the range 0 to 1000 (inclusive range) and searching for the keys 88, 888, 515, 540, -2, 2000, 1, 0, and 1000. For each search, print out the search key and the returned index from vour search function
Expert Answer
Answer to 7. (6 points) A friend suggests that if cutting a dividing array in half works well for binary search, then cutting into… . . .
OR

