1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Crank
3 years ago
14

A binary search algorithm is written (as in the modules, for example) which searches a pre-sorted array for some user-defined va

lue, clientData. If clientData is stored in the array, it returns its array position, and if not found, it returns -1 (again, just like in the modules). Assume the array to be searched has 100 data elements in it. (Check all that apply):[NOTE: due to common off-by-one interpretations when counting such things, if your predicted answer is within one (+1 or -1) of a posted option below, you can assume your prediction and the choice you are looking at are equivalent and check that option.]A. It might return to the client with an answer after only one comparison of data.B. It may require as many as 99 comparisons of data before it returns.C. It will always return with an answer in 7 or fewer comparisons of data.D. It will always return with an answer in 3 or fewer comparisons of data.
Computers and Technology
1 answer:
Mazyrski [523]3 years ago
4 0

Answer:

c) it will always return with an answer of 7 or fewer comparisons of data.

Explanation:

As maximum number of comparison in worst case for sorted binary search is log₂n, here n = 100, so maximum search is at least 6.6 which is approximately 7.

You might be interested in
PLZ HELP ASAP
fenix001 [56]

Answer:

Did this computer get a virus.

Explanation:

The brother can't change the password because it required him to get the old password before changing it.

4 0
2 years ago
Sum of 18/7 and 13/7 is *​
NARA [144]
The sum would be 31/7, or 4.428571428571429 in decimal form.
7 0
3 years ago
Read 2 more answers
Exercise : Randomizer In this exercise, we are going to create a static class Randomizer that will allow users to get random int
Nutka1998 [239]

Answer:

Here the code is by using java.

Explanation:

//Randomizer.java

public class Randomizer {

public static int nextInt() {

//get random number from 1-10

int randInteger = (int) (Math.random() * (11) + 1);

//if number is greater than 10 or less than 1

while (randInteger > 10 || randInteger < 1) {

randInteger = (int) (Math.random() * (11) + 1);

}

return randInteger;

}

public static int nextInt(int min, int max) {

//formula to get random number from min-max

int randInteger = (int) (Math.random() * (max + 1) + min);

while (randInteger > max || randInteger < min) {

randInteger = (int) (Math.random() * (max + 1) + min);

}

return randInteger;

}

}

//RandomizerTester.java

public class RandomizerTester {

public static void main(String[] args) {

System.out.println("Results of Randommizer.nextInt()");

for (int i = 0; i < 10; i++) {

System.out.println(Randomizer.nextInt());

}

int min = 5;

int max = 10;

System.out.println("\n Results of Randomizer.nextInt(5,10)");

for (int i = 0; i < 10; i++) {

System.out.println(Randomizer.nextInt(min, max));

}

}

}

OUTPUT:

Results of Randommizer.nextInt()

9

2

3

8

5

9

4

1

9

2

Results of Randomizer.nextInt(5,10)

9

8

9

7

5

10

5

10

7

7

4 0
2 years ago
Which statement compares the copy and cut commands?
ella [17]

Answer: duplicate

Explanation:

5 0
2 years ago
Read 2 more answers
In Super Mario 64, a character called Lakitu follows Mario around on a cloud, filming him with a camera as though he were shooti
ella [17]

Answer:

A second person prespective

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • What is a way to Procter your social security number and other sensitive information from identity theft
    9·1 answer
  • Fix the 2 error codes.
    14·1 answer
  • The ________ of the operating system enables users to communicate with the computer system. modem window network adapter card us
    14·1 answer
  • Your grandmother was an established artist and left you several original paintings after she died. Which of these statements is
    6·1 answer
  • Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
    13·2 answers
  • A network technician is tasked with designing a firewall to improve security for an existing FTP server that is on the company n
    9·1 answer
  • What type of information is kept on a database?
    10·1 answer
  • The construction of a mixed media assemblage would be considered
    9·1 answer
  • . What type of computer implementation does the following code represent? Load A,10 Load B,1:5 Add A,B STORE A, [20]
    5·1 answer
  • 50 POINTS!!!!!!!!!!!<br><br> Give at least two examples of how the transport layer is used.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!