Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:00, maxy7347go
Which factor is the most important when choosing a website host? whether customers will make secure transactions the number of email accounts provided the purpose of the website the quality of the host control panel
Answers: 3
image
Computers and Technology, 23.06.2019 18:00, joybeth9591
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, wilkinsonei4069
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a, b] se pot scrie ca produs de două numere prime? “.
Answers: 1
image
Computers and Technology, 24.06.2019 01:00, cheycheybabygirl01
How can the temperature of a room be raised by 5degreesf?
Answers: 1
Do you know the correct answer?
What would be the value of list after four passes of the help() method? public void sort( int[] lis...

Questions in other subjects:

Konu
Social Studies, 08.07.2019 16:50