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
there were 2,683 books sold at a bookstore this year. there were 1,317 more books sold last year. how many books were sold last
Nadya [2.5K]

Answer:

4,000

Step-by-step explanation:

you take this years total (2683)

and add how many more there was last year (1317)

then you get 4000!!

hope it helps

4 0
3 years ago
Which of these numbers is irrational?
Sidana [21]
<span>Which of these numbers is irrational?
a. square root of 3
b. 0.25
c. 1/5
d. square root of 9

answer
</span><span>a. square root of 3
</span><span>--------------------------------
What is (-7)^5 in expanded form?
a. -7 • -7 • -7 • -7 • -7 
b. -7 • 5
c. (-7) • 7 • (-7) • 7 • (-7) • -7
d. 5 • 5 • 5 • 5 • 5 • 5 • 5

answer

</span><span>a. -7 • -7 • -7 • -7 • -7 </span>
6 0
3 years ago
a tank is 3/7 full of water.After removing 420 litres it became 12/35 full .how much can the tank hold when full? ​
insens350 [35]

Answer:

4900 Litres

Step-by-step explanation:

First we need a common demoninator:

3/7=15/35

Then we subtract the two to figure out how much 420 Litres is:

15/35-12/35=3/35

3/35=420 litres

Divide amount by the numerater for thow much 1/x is.

1/35=140

and multiply by the denomenator to get a full number on your fraction, and therefore a full tank.

140 x 35 = 4900

5 0
1 year ago
NEED HELP PLEASE
ludmilkaskok [199]

Answer:

16 feet, 18 feet, and 25 feet.

Step-by-step explanation:

<h2><u><em>PLEASE MARK AS BRAINLIEST!!!!!</em></u></h2>
4 0
3 years ago
Jane is planting flowers in her garden. She planted 8 flowers on Saturday and 10 on Sunday. So far she planted 2/5 of her flower
STALIN [3.7K]
She has 45 flowers, 18/2=9, 9*5=45
3 0
3 years ago
Read 2 more answers
Other questions:
  • Was i right on the first 2? Please correct them if i'm wrong
    8·1 answer
  • How do I figure out 2/3(5*4)/3+6/7=
    8·1 answer
  • Solve for h. a = ch + f A. h = B. h = C. h = a/c – f D. h =
    10·1 answer
  • Simplify. rewrite the expression in the form b^nb ​n ​​ b, start superscript, n, end superscript. b^{-6}\cdot b^{11}
    5·2 answers
  • If Cos A &gt;0, and Csc A &lt; 0, what quadrant does A lie?
    11·1 answer
  • Use linear regression to find the equation for the linear function that best fits this data. Round both numbers to two decimal p
    7·1 answer
  • PLEASE HELP ME ASAP!!!! GIVING 20 POINTS AWAY!!
    9·1 answer
  • PLEASE HELP !! (Sorry if the picture is blurry) ....Amanda is baking cookies for a holiday party. She wants to bake more cookies
    12·1 answer
  • What is the area of the following rectangle?
    13·1 answer
  • Can someone help me with this, I got 115 from 180-65 is this right?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!