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
A company produces coffee makers. The labor cost of assembling one coffee maker during the regular business hours is $2.65. If t
DochEvi [55]

Answer:

520

Explanation:

Let's say the x = smallest number of units that must be assembled during the regular hours, and 660-x is the number of units that can be assembled in overtime. Then, the total cost should be smaller than or equal to cost1 *x + cost2*3.75

⇒ (x * 2.65) + ((660 - x) * 3.75) <= 1903

⇒ x * (2.65 - 3.75) + (660 * 3.75) <= 1903

⇒ 1.1 * x >= 2475 - 1903

⇒ 1.1 * x >= 572

⇒ x >= 520

6 0
4 years ago
What is the difference between images and pictures
julia-pushkina [17]
An image is a representation of a person or thing but a picture is a painting or drawing
6 0
3 years ago
Name and define (or list the set that defines) three of the four common data types in programming.
Dominik [7]

Answer: this is the  Answer your question

6 0
3 years ago
Can development and conservation of environment go hand-in-hand? Explain your point of view
Wewaii [24]

No, development and conservation of environment cannot hand in hand.

Explanation:

Because during the developmental process the destruction of the environment is necessary.For example,if you want to construct a Road which is one of the developmental activity,so to construct road the clear of forest is must .

5 0
3 years ago
G The method of mapping where each memory locationis mapped to exactly one location in the cache is
Otrada [13]

Answer:

Direct Mapped Cache

Explanation:

Given that a Direct Mapped Cache is a form of mapping whereby each main memory address is mapped into precisely one cache block.

It is considered cheaper compared to the associative method of cache mapping, and it is faster when searching through it. This is because it utilizes a tag field only.

Hence, The method of mapping where each memory location is mapped to exactly one location in the cache is "Direct Mapped Cache"

4 0
3 years ago
Other questions:
  • The Boffo Balloon Company makes helium balloons. Large balloons cost $13.00 a dozen, medium-sized balloons cost $11.00 a dozen,
    13·1 answer
  • Operating systems that have windows and icons have which type of user interface?
    15·1 answer
  • Up to 10 people is a good guideline for the size of your study group.
    15·1 answer
  • A recent antivirus scan on a server detected a Trojan. A technician removed the Trojan, but a security administrator expressed c
    6·1 answer
  • Which of these practices should you follow while creating your resume?
    13·2 answers
  • Write the definition of a method, oddsMatchEvens, whose two parameters are arrays of integers of equal size. The size of each ar
    10·1 answer
  • Your mom calls you. She is creating a book of poetry. Many of these poems only take up the first half of a document . She asks i
    10·2 answers
  • How do you delete an credit card off an iPhone 7
    5·1 answer
  • The power saving state that saves all work to the hard drive and powers down the system is known by what term?
    11·1 answer
  • What city, the major financial center of its country, is located on the northern coast of the island where the poet who wrote "A
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!