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]
3 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]3 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
Which of the following are the functions of an os?
cricket20 [7]
Manage the computer's resources, such as the central processing unit, memory, disk drives, and printers, (2) establish a user interface, and (3) execute and provide services for applications software.
6 0
3 years ago
Module 1 and 2 Coding Guided Notes Fill in your answers to each response as you read through the lesson pages in the coding cour
creativ13 [48]

Answer:

Code; code; program.

Explanation:

1. Instructions for computers to solve a problem is known as code. Computer code is how humans and machines talk to each other. Some examples of programming language used to write a code in instructing a computer for the execution of a task are python, Java, Javascript, ruby, c++, c# etc.

2. Learning to code or write a program allows for a solution to a problem.

4 0
3 years ago
Read 2 more answers
If I delete the emoji free app will I still have the emojis on my phone?
egoroff_w [7]
<span>If you delete the Emoji application from your phone there is a possibility the Emoji's will still hang around. It all depends on the way you set up the app on your phone. Some people opt to have settings and changes to the app saved on their SD card and some don't. If you save updates and changes to the app to your SD card you will still have remnants on your phone after deleting the app</span>
5 0
4 years ago
Read 2 more answers
Which of the following is NOT a possible combination of values of the variables in this program when it finishes running?
Nady [450]

Answer:

Definitely D

Explanation:

When you flip a coin it’s a 50/50 chance. Meaning it’s equal.

7 0
3 years ago
Read 2 more answers
Define a class Complex to represent complex numbers. All complex numbers are of the form x + yi, where x and y are real numbers,
Ksenya-84 [330]

Answer:

The program in C++ is as follows:

#include<bits/stdc++.h>

using namespace std;

class Complex {

public:

 int rl, im;

Complex(){ }

Complex(int Real, int Imaginary){

 rl = Real;  im = Imaginary;

}

};

int main(){

   int real, imag;

   cout<<"Real: ";    cin>>real;

   cout<<"Imaginary: ";    cin>>imag;

Complex ComplexNum(real, imag);

cout<<"Result : "<< ComplexNum.rl<<" + "<<ComplexNum.im<<"i"<<endl;

}

Explanation:

See attachment for explanation

Download cpp
7 0
3 years ago
Other questions:
  • Windows on the desktop are just one of many objects used in a graphical user interface (GUI)-- buttons, drop-down list boxes, po
    7·1 answer
  • Select the strategies below that are likely to increase audience attention.
    14·2 answers
  • A teacher wants a program to give extra points to students who fail a test. Write a Python program to do the following: (a) Ask
    5·1 answer
  • You have the following code: string name; cout &lt;&lt; "Enter your name : "; cin &gt;&gt; name; If a user enters "Mary Smith" a
    10·1 answer
  • In the Mouse Properties window, you can_____. A. change the color of the pointer.
    9·2 answers
  • true or false then EXPLAIN why. Since many forms of money do not earn interest, people's demand for money is unaffected by chang
    14·2 answers
  • Yo need help can someone plz help
    7·1 answer
  • Define computer memory and write its type <br>​
    10·2 answers
  • Select the one that uses the heading tag correctly. <br><br>a. <br><br><br>b. <br><br>c. <br><br>d.
    12·2 answers
  • What method does a gsm network use to separate data on a channel?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!