Given the following array of size 10: a=[2, 4, 6, 8, 10, 12, 14,…

Given the following array of size 10: a=[2, 4, 6, 8, 10, 12, 14,… Given the following array of size 10_a=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]How many elements will be compared using a binary search to look for the number 15?The pseudocode looks like the followingfunction binarySearch(array, first, last, toFind) {    if first > last return -1;    mid = first + ((last – first) / 2);    if arr[mid] == toFind return mid;    if arr[mid] > toFind return binarySearch(array, first, mid – 1, toFind);    if toFind > arr[mid] return binarySearch(array, mid + 1, last, toFind);}Group of answer choices3 4 1 2  Computer Science Engineering & Technology Java Programming CSC MISC

Leave a Comment

Your email address will not be published. Required fields are marked *

Order your essay today and save 30% with the discount code ESSAYHELP