Using C++; Binary search. Write a function that given an sorted array ofintegers A (ascending order)

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Order a Similar Paper Order a Different Paper

Using C++; Binary search. Write a function that given an sorted array ofintegers A (ascending order) and an integer value x, searches forthe x in A using binary search. The function returns the indexwhere the value of x is found, and -1 if it is not found.Furthermore, the function should return the number of comparisonsit performs. int binSearch(int x, int A[], int size, int &numComp); Attached