Question: In C++ please! Binary Search Given the code below, complete the binary search function where the data is sorted in descending order. The function will
In C++ please! Binary Search
Given the code below, complete the binary search function where the data is sorted in descending order. The function will return the vector slot where the input target is found. If the target is not found, return -1.
Examples: (assume the vector is 60, 50, 40, 30, 20, 10)
input:
50
output:
1
input:
15
output:
-1


Given the code below, complete the binary search function where the data is sorted in descending order. The function will return the vector slot where the input target is found. If the target is not found, return-1. Examples: (assume the vector is 60,50, 40, 30, 20, 10) input: 50 output: 1 input: 15 output: -1 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
