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
Kaylis [27]
2 years ago
15

An array similar to a phone book has 1000 names arranged as names [0], names[1]....names[999]. Nancy wants to search a name X in

this array. Which of the following preconditions must she ensure to perform a binary search?
a. The list has a large number of names.
b. The name X is present in the list.

In addition to the two statements above, which of the following is correct?

a. There should be no duplicates in the list.
b. The names in the list should be alphabetical order.
c. The name X should occur near the middle of the list.
Computers and Technology
1 answer:
sammy [17]2 years ago
5 0

Answer:

b. The names in the list should be in alphabetical order.

Explanation:

A binary search is an algorithm used for searching for an item in a list or array. The algorithm first sorts the data structure into order and then divides it into halves. If the searched item is less than the middle item in the list, then the algorithm searches for the target in the first half, else, in the second half. This reduces the time complexity of the search.

You might be interested in
What technique is used when setup times at a workstation are sequence dependent?
grigory [225]

Answer:

johnsons rule minimizes total idle time for both machines or work centers. What technique is used when setup times at a workstation are sequence dependent? determine the total time of each job sequence permutation considering the setup time and choose the best (lowest) time.

Explanation:

please mark me as brainliest thank you

3 0
3 years ago
Which of the following is not a concern that has come out of the widespread adoption of the Internet?
slamgirl [31]

Answer:

The correct option is;

Selecting the correct browser to use for the sites you want to visit

Explanation:

Censorship of information is the subduing of information based on the consideration of such information being harmful or inconvenient

Increased anonymity

Making an individual anonymous which is one of the capabilities of the internet, is seen as encouraging unethical behavior and promoting discussions which are deemed uncivil in a commonly shared space online.

Unauthorized sharing of copyrighted information

The sharing and distribution of copyrighted material is against the law but it is a common occurrence and in various formats online

Out of the given options, selecting the correct browser to use for the sites you want to visit is the one that is not a concern.

5 0
3 years ago
write a java program that prompts the user to enter scores (each number an integer from 0 to 10) and prints the following output
Vladimir [108]

Answer:

Explanation:

The following is written in Java. It continues asking the user for inputs until they enter a -1. Then it saves all the values into an array and calculates the number of values entered, the highest, and lowest, and prints all the variables to the screen. The code was tested and the output can be seen in the attached image below.

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int count = 0;

       int highest, lowest;

       ArrayList<Integer> myArr = new ArrayList<>();

       while (true) {

           System.out.println("Enter a number [0-10] or -1 to exit");

           int num = in.nextInt();

           if (num != -1) {

               if ((num >= 0) && (num <= 10)) {

                   count+= 1;

                   myArr.add(num);

               } else {

                   System.out.println("Wrong Value");

               }

           } else {

               break;

           }

       }

       if (myArr.size() > 3) {

           highest = myArr.get(0);

           lowest = myArr.get(0);

           for (int x: myArr) {

               if (x > highest) {

                   highest = x;

               }

               if (x < lowest) {

                   lowest = x;

               }

           }

           System.out.println("Number of Elements: " + count);

           System.out.println("Highest: " + highest);

           System.out.println("Lowest : " + lowest);

       } else {

           System.out.println("Number of Elements: " + count);

           System.out.println("No Highest or Lowest Elements");

       }

   }

}

4 0
2 years ago
ASAP! WILL MARK BRAINLIEST + 100 POINTS!!<br><br> Match each word to its description.
Naily [24]

When was the Ming dynasty established?

the 1100s CE

the 1200s CE

the 1300s CE

the 1400s CE

4 0
2 years ago
Read 2 more answers
There are___standard colors for text in a theme.
Stella [2.4K]
There are two standard colors for a text in a them
6 0
3 years ago
Other questions:
  • You can use Facebook's live feed tool to broadcast content as you post it
    8·2 answers
  • Which of the following correctly orders the investments from LOWER risk to HIGHER risk?
    7·2 answers
  • What year did buck tooth bob become famous
    11·2 answers
  • Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer pr
    15·1 answer
  • You are running out of storage space on one of your servers. you need to purchase an external hard drive, as there are no drive
    8·2 answers
  • In the world of computing,accessibility MOST often refers to what
    12·1 answer
  • What output is generated by this for loop?
    6·1 answer
  • Pride Group of Companies is making tremendous profits in different categories of electronic goods. The group of managers have to
    12·1 answer
  • An information system is the set of steps that needs to be followed to ensure that software development proceeds in an orderly f
    13·1 answer
  • You have an audio that contains one pause for 0.2 seconds and another one for 0.6 seconds. When do you need to create a new segm
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!