Given the following function definition, will repeated calls to the search function for the same target find all occurre
Posted: Sun May 15, 2022 8:44 am
Given the following function definition, will repeated calls to the search function for the same target find all occurrences of that target in the array? int search(const int array(), int target, int numElements) { int index=0; bool found=false; while((!found) && (index < numElements)) { if(array[index] target) found=true; a . else index++; 1 Af(found true) return index: else return -1;
a) Yes Ob) No c) Impossible to tell without looking at the values of the array d) It depends on the value of target.
a) Yes Ob) No c) Impossible to tell without looking at the values of the array d) It depends on the value of target.