In the function definition of a binary search algorithm, what's the purpose of first <= last in this line of code?
Also, why does one have to be subtracted from the number of elements in the for loop in a linear search algorithm?Code:while (!found && first <= last)
Code:for (int i = 0; i < number_of_elements - 1; i++)