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, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
question
Computers and Technology, 23.06.2019 22:40
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Along what line of action can the camera move to follow the movement of actors for screen direction? a. along a 90-degree arcb. along a 120-degree arcc. along a 180-degree arcd. along a 360-degree arc
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Jenny wants to create an animated short video to add to her website. which software will she use to create this animated video?
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, 21.11.2019 06:31
Questions on the website: 13722365