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
HELP ME PLEASE PLEASE
Ymorist [56]

Answer:

The value of x is 7 and y is 14.

Step-by-step explanation:

The steps are :

- 3x + y =  - 7 -  -  - (1)

y = x + 7 -  -  - (2)

(2)→(1)

- 3x + (x + 7) =  - 7 \\  - 3x + x + 7 =  - 7 \\  - 2x =  - 14 \\ x = 7

substitute \: x = 7 \:  \: into \:  \: (2)

y = 7 + 7 \\ y = 14

6 0
3 years ago
Please Help Me!
alexdok [17]

Answer:

The answer to your question is below

Step-by-step explanation:

                 (2x⁴ + 7x³ - 3x + 9) - (6x⁴ - 3x³ - 6x² - 17)

Step 1. take out the parenthesis, in the second term, change the signs

                  2x⁴ + 7x³ - 3x + 9 - 6x⁴ + 3x³ + 6x² + 17

Step 2. Group like terms

                  (2x⁴ - 6x⁴) + (7x³ + 3x³) + (6x²) + (-3x) + (9 + 17)

Step 3. Simplify like terms

                          -2x⁴ + 10x³ + 6x² - 3x + 26

                 

3 0
3 years ago
I need help like really bad.
Lelechka [254]

Answer:

PEMDAS

Step-by-step explanation:

parenthesis

Exponents

Multiply

Divide

Add

Subtract

6 0
3 years ago
Construct one circle with center A passing through point B and another circle with center A passing through C. Circles with comm
solniwko [45]

Answer:

The two circles centered at point A are concentric and similar.

3 0
3 years ago
PLSSSSSS!!!! HELP ME I WILL MARK YOU!!!!!!! MATH!!!!!!!!!!!!!!
scoundrel [369]

Answer:

-24

Step-by-step explanation:

-1(3^2)+(-15)

  -9+(-15)

      -24

8 0
3 years ago
Read 2 more answers
Other questions:
  • Triangle ABC is congruent to triangle DFE. Find x
    12·1 answer
  • bridget makes 50 cookies to handout at school.if she has handed out 20 cookies,what percent does she have left​
    9·1 answer
  • What is the sum of 80 minutes and 40 minutes?
    13·2 answers
  • I want to plant 45 sunflower plants and 81 rose plants in my garden. If I put the same number of plants in each row and each row
    15·1 answer
  • Which country has the largest gross domestic product of all the industrial nations? A) United States B) Japan
    5·2 answers
  • 1 13/15 divided by 1 2/5
    11·2 answers
  • 100% ©<br> A survey was conducted of students at a high school and at a college to determine students' favorite subjects. The re
    15·1 answer
  • What is the square root of 16
    12·2 answers
  • In a race , Ram covers 5 km in 20 min. How much distance will he cover in 100 min ?
    15·1 answer
  • Brent counted 5 red cards, 10 black cards, and 20 blue cards in a deck of cards. What is the ratio of blue cards to red cards?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!