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
Solve the inequality. -6b>42 or 4b>-4
goldfiish [28.3K]
- 6b > 42 or 4b > - 4
Divide by - 6. Divide by 4.
b < - 7 Or b > - 1
7 0
3 years ago
An angle measures 28° more than the measure of its complementary angle. What is the measure of each angle?
navik [9.2K]

Answer:

62°

Step-by-step explanation:

Complementary angles by definition are two or more angles that add up to 90°. So we must do 90°-62° to get the missing angle which is 62°.

Hope that helped.

7 0
3 years ago
You deposit $ 1200 in an account. The annual interest rate is 3%. How long will it take you to earn $108 in simple interest?
alukav5142 [94]
The correct answer is 3
5 0
3 years ago
Leorys favorite basketball player is 6 feet 8 inches tall how tall i leorys favorite basketball player in inches
sladkih [1.3K]
Answer:  " 80 inches " .
_______________________________
Explanation:
_______________________________
6 feet  + 8 inches = ?

Note: 12 inches = 1 ft.

6 ft * (12 inches/ ft) = 72 inches; 
______________________________
72 inches + 8 inches = 80 inches.
_______________________________
5 0
3 years ago
Use slope-intercept method help me
g100num [7]

Answer:

y=4x+3

Step-by-step explanation:

Find the intercept - that is 3

Find the slope - that is 4

7 0
3 years ago
Other questions:
  • Which relation is a direct variation that contains the ordered pair (2, 7)?
    10·1 answer
  • The table shows the outputs, y, for different inputs, x:
    12·1 answer
  • Which is an equation of the line through (-1,-4) and parallel to the line 3x + y = 5? ​
    8·1 answer
  • Evaluate the series 8+4+2+...​
    6·1 answer
  • Tell the measure of the angle in degrees 1/10
    6·2 answers
  • How can I graph the inequality equation h &lt; -15
    14·1 answer
  • Solve the equation for the red variable.
    14·1 answer
  • Please help me solve this!!!!!
    8·1 answer
  • WILL MARK BRAINLIEST
    11·1 answer
  • Help me pleeeeeeeeassse!!!!!!!
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!