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
Stella [2.4K]
3 years ago
12

Suppose you are doing a binary search of the list [15, 18, 2, 19, 18, 0, 8, 14, 19, 14]. How many comparisons would you need to

do in order to find the key 19?
Mathematics
1 answer:
Illusion [34]3 years ago
7 0

Answer:

Three Times.

Step-by-step explanation:

First and foremost a binary search requires that the array be sorted in ascending or descending order.

After the initial step the search goes to the middle most value

i.e. [0, 2,8,14,14,15,18,18,19,19]  

will be the second 14, which is the first iteration.

Since 14 is less than 19 the search will eliminate  the lower half of the including 14, and will iterate again through the array:

[15,18,18,19,19]

The array will go to the middle most value which is 18, second iteration. Since 18 is less than 19, the program will eliminate the lower half and be left with two values i.e. [19,19].

The search will run once i.e. third iteration, and will return key value found.

You might be interested in
Whoch of the following statements are true? Select all that apply
sineoko [7]

Answer:

C and D

atleast 20 characters to explain it well

8 0
3 years ago
What are the two solutions of <br><br>2|2y-1| + 5 = 19​
Bess [88]

Answer:

y=4

y=−3

Step-by-step explanation:

8 0
3 years ago
Read 2 more answers
Is it A<br><br> B<br><br> C<br><br> D<br><br> Will be marked as crown
Solnce55 [7]
The answer is B just took the test
3 0
3 years ago
Read 2 more answers
Solve
VashaNatasha [74]

Answer:

1,2,1

Step-by-step explanation:

4 0
3 years ago
Which of the following is equal to 5^1/3?
mestny [16]

Answer:

1.67 is the answer unless it is 1.6 or 1.66666667

Step-by-step explanation:


8 0
3 years ago
Other questions:
  • A number from 18 to 24 is drawn at random. What is the probability that the answer is a number less than 24?
    7·2 answers
  • Suppose there are two cubes, with the first cube having a side of h, and the second cube having a side of 5h. What is the relati
    10·1 answer
  • I WILL MARK BRAINLIES If √ x has a decimal approximation of 3.4, then x is between which two integers? In your final answer, inc
    11·2 answers
  • What's the first ten numbers of pie​
    7·2 answers
  • Factor each expression and explain how you solved it.
    9·1 answer
  • A restaurant is open 24 hours a day. The manager wants to divide the day into work shifts of equal length. The shifts should not
    10·2 answers
  • How many groups does it take to equally distribute 2 5/8?
    14·1 answer
  • Find the perimeter and area of the figure.<br> 5 m<br> 3 m<br> 4 m
    15·2 answers
  • A cylinder has a height of 12 inches and a radius of 1.5 inches. What is its voulme? Round your answer to the nearest tenth. Use
    9·2 answers
  • Does a perpendicular bisector have to be a line?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!