subject

Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fraction bar. Observe the given code.

private static int[] u={2,7,9,11,21,26,35,44};
public static int binaryS(int key)
{

int first=0;
int last=u. length-1;
while(first<=last)
{
int middle=(first+last/2);
if (u[middle]==key)
return middle;
else if(u[middle] first=middle+1;
else
last=middle-1;
}
return -1;
}

What will be stored in x after executing the following statement?

int x= binaryS(2);

The output will be
.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
George is working as a programming team lead. which statements correctly describe the skills that he requires?
Answers: 3
question
Computers and Technology, 25.06.2019 01:30
The physical parts or components of a computer system is called .
Answers: 1
You know the right answer?
Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fract...
Questions
question
Mathematics, 25.06.2019 10:30
question
Health, 25.06.2019 10:30