subject

What would be the value of list after four passes of the help() method? public void sort( int[] list, int front, int back)
{
int mid = (front+back)/2;
if( mid==front) return;
sort(list, front, mid);
sort(list, mid, back);
help(list, front, back);
}

private void help(int[] list, int front, int back)
{
int[] temp = new int[back-front];
int i = front, j = (front+back)/2, k =0;
int mid =j;
while( i ray[max])
max = j;
}
if( max != i){
int temp = ray[max];
ray[max] = ray[i];
ray[i] = temp;
}
}
}
a
7
b
10
c
11
d
9
e
8

If funSearch( ) will only work on sorted data, what type of sort is funSearch() ?

int funSearch( int[] list, int val )
{
int len=list. length;
int bot=0, top=len-1;
int middle=0;
while(bot<=top)
{
middle=(bot+top)/2;
if (list[middle] == val)
return middle;
else
if(list[middle]>val)
top=middle-1;
else
bot=middle+1;
}
return -1;
}
a
whatASearch
b
linearSearch
c
quickSearch
d
binarySearch
e
selectionSearch

If funSearch() is passed a list that contains 100 integers in sorted order, how many checks will funSearch() have to make before it determines that the item it is searching for is NOT in the list ?

int funSearch( int[] list, int val )
{
int len=list. length;
int bot=0, top=len-1;
int middle=0;
while(bot<=top)
{
middle=(bot+top)/2;
if (list[middle] == val)
return middle;
else
if(list[middle]>val)
top=middle-1;
else
bot=middle+1;
}
return -1;
}
a
7
b
9
c
6
d
5
e
8

Please and thank you.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
question
Computers and Technology, 23.06.2019 00:20
Ihave been given the number of guns per 100, and the total firearm-related deaths per 100,000. i have to find the actual number of guns per country and actual number of gun-related deaths. if somebody could show me how to do 1 question, i can finish the rest, i am just confused. tia
Answers: 3
You know the right answer?
What would be the value of list after four passes of the help() method? public void sort( int[] lis...
Questions
question
Biology, 05.07.2019 06:30
Questions on the website: 13722359