Question: need this in a C++ program using this Pseudocode that implements and test the Binary search algorithm. Please follow the Linear Search algorithm C++ code

MAC281 Assignment The pseudocode below describes the binary search algorithm. Use the pseudocode to write a C++ program that implements and tests the binary search algorithm. Note: YOU MUST FOLLOW THE STEPS IN THE GIVEN PSEUDOCODE. DO NOT USE ALTERNATIVE ALGORITHMS. Pseudocode: The Binary Search Algorithm 1 procedure binary search (x: integer, a1, a2,...,an: increasing integers) 2 ili is left endpoint of search interval) 3jnj is right endpoint of search interval} 4 while i < j 5 6 7 8 m = [(i+j)/2] if xam then i := m + 1 else jm if x=a, then location = i 9 else location := 0 10 return location (location is the subscript i of the term a, equal to x, 11 or 0 if x is not found}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
