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
Jonathon's Yo-Yo has a string that is three and a half feet long. If Jonathon cuts six inches off of the string, how many feet w
earnstyle [38]
1 ft= 12 inches
1/2 ft= 6 inches

=3 1/2 feet - 6 inches
substitute # of inches in for 1/2 foot
=3 ft 6 inches - 6 inches
=3 feet

ANSWER: 3 feet

Hope this helps! :)
7 0
3 years ago
Find f (3) +g(1) – g(3) =
pantera1 [17]
Sorry I don’t know the answer hope you find one bye halleluja
3 0
3 years ago
X * 4 = x + 1.5 = help plzzzzzz!
Leona [35]

Answer:

5

Step-by-step explanation:

x × 4 = x + 15

4x = x + 15

-x -x

3x= 15

-- --

3 3

x = 5

// have a great day //

3 0
3 years ago
Read 2 more answers
There were 200 melons in a box and they were distributed to 3 children in the ratio of 4:3:3. The first child sold the melons at
Elena L [17]

Answer:

$460

Step-by-step explanation:

let the number of melons be x

4x + 3x + 3x = 200 melons

10x = 200 so, x will be 20

4x = 80 melons

3x = 60

3x = 60

amount made by 1st child = 80 × $2 = 160$

the remaining melons are 60 + 60 = 120

amount collected: they sold them in groups of 2 and each group was $5. so,

120÷2 × $5 = $300

total amount = 300 + 160 = $460.

6 0
3 years ago
Simplify negative 4 and 1 over 6 − negative 6 and 1 over 3. Which of the following is correct?
Pavlova-9 [17]

The correct answer is 2 1/6.

Good Luck...:)

3 0
3 years ago
Read 2 more answers
Other questions:
  • Write expression using the distributive property to find the product of 9 x82
    10·1 answer
  • 58.15<br> If f(x) = 5x + 40, what is f(x) when x = -5?
    14·1 answer
  • Help me please do it ASAP
    12·2 answers
  • There are 10 boys and 10 girls in a classroom.
    10·2 answers
  • A pair of sunglasses cost $26 during the summer sale. If
    9·1 answer
  • Terrel lives 2 5/6 blocks away from his best friends house. His school is 4 1/3 blocks away in the same direction. If he stops a
    15·1 answer
  • Write an equivalent expression<br>8x - 6x + 10y + 6 + 4y + 9 = ?x + ?y + ?​
    9·1 answer
  • PLEASE HELP ASAP!! CORRECT ANSWER ONLY PLEASE!!!
    8·1 answer
  • Please help I really need it
    6·2 answers
  • Helpppppppppppppppppppoppp
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!