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]
4 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]4 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
What is the answer to. Write a polynomial equation with integer coefficients that has the given roots, x=7 and x=-5
rewona [7]
\bf \begin{cases}
x=7\implies &x-7=0\\
x=-5\implies &x+5=0
\end{cases}\implies (x-7)(x+5)=\stackrel{original}{polynomial}
\\\\\\
x^2-2x-35=y\implies 1x^2-2x-35=y
7 0
3 years ago
Zoe is 16 years old. Her brother, Luke, is 3 years more than half her age. Write a numerical expression for Luke's age.
olga nikolaevna [1]

Answer:

<u><em>16 : 2 + 3 </em></u>  (remember pemdas)

Step-by-step explanation:

Zoe is 16 years old. Her brother, Luke, is 3 years more than half her age. Write a numerical expression for Luke's age.

16 : 2 + 3 = 11

8 0
2 years ago
The Garcia family started the day with 2 gallons of milk. They drank 111 quart of milk for breakfast and 3 pints for lunch.
irina1246 [14]
3 pints

There are 8 pints of milk in 1 gallon. There is also 4 quarts in 1 gallon. So each quart is 2 pints.
After breakfast they had 3 quarts of the original gallon left since 4 - 1 = 3.
3 quarts is the same as 6 pints. They drank 3 pints at lunch. This means 6 - 3 = 3. After lunch, there were 3 pints left.
6 0
3 years ago
PLEASE ANSWER THIS QUICK!!!!
Dovator [93]

Answer:

you need 5 buses and 4 will be totally full and one will only be 1/3 full

or you can have 14% of all 5 buses with empty seats

Step-by-step explanation:

6 0
3 years ago
The U.S. Census Bureau conducts a study to determine the time needed to complete the short form. The Bureau surveys 200 people.
NISA [10]

Answer:

8.2-2.58\frac{2.2}{\sqrt{18}}=6.86    

8.2+2.58\frac{2.2}{\sqrt{18}}=9.54    

So on this case the 90% confidence interval would be given by (6.86;9.54)    And the error is given by:

ME= 2.58\frac{2.2}{\sqrt{18}} =1.338

Step-by-step explanation:

Previous concepts

A confidence interval is "a range of values that’s likely to include a population value with a certain degree of confidence. It is often expressed a % whereby a population means lies between an upper and lower interval".

The margin of error is the range of values below and above the sample statistic in a confidence interval.

Normal distribution, is a "probability distribution that is symmetric about the mean, showing that data near the mean are more frequent in occurrence than data far from the mean".

\bar X=8.2 represent the sample mean for the sample  

\mu population mean (variable of interest)

\sigma=2.2 represent the population standard deviation

n represent the sample size  

Solution to the problem

The confidence interval for the mean is given by the following formula:

\bar X \pm z_{\alpha/2}\frac{\sigma}{\sqrt{n}}   (1)

Since the Confidence is 0.90 or 90%, the value of \alpha=0.1 and \alpha/2 =0.005, and we can use excel, a calculator or a table to find the critical value. The excel command would be: "=-NORM.INV(0.005,0,1)".And we see that z_{\alpha/2}=2.58

Now we have everything in order to replace into formula (1):

8.2-2.58\frac{2.2}{\sqrt{18}}=6.86    

8.2+2.58\frac{2.2}{\sqrt{18}}=9.54    

So on this case the 90% confidence interval would be given by (6.86;9.54)    And the error is given by:

ME= 2.58\frac{2.2}{\sqrt{18}} =1.338

8 0
3 years ago
Read 2 more answers
Other questions:
  • Need help with 27 , 29, and 30. ASAP please this is due in 30 minutes
    15·1 answer
  • Javier has a basket of oranges and apples. The number of oranges is 2 more than twice the number of apples in the basket. The di
    8·1 answer
  • The sum of 2 numbers is 44 the smaller number is 16 less than the larger number what are the numbers
    11·1 answer
  • Suppose an airplane climbs 15 feet for every 40 feet it moves forward. What is the slope of this airplane's ascent?
    15·1 answer
  • I need help on 4,5,6,7,8,9 asappppp
    15·1 answer
  • MUSTONENTS
    5·1 answer
  • Can someone help me with this question?
    11·1 answer
  • Piper was out at a restaurant for dinner when the bill came. Her dinner came to $16. After adding in a tip, before tax, she paid
    14·2 answers
  • A bookstore charges a standard rate for paperback and hardback bestseller books. The cost of each paperback book is $8 less than
    5·2 answers
  • Find the 11th term of the arithmetic sequence<br> 2x - 2, 5x – 9, 8x – 16,...
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!