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
xenn [34]
3 years ago
7

Identify the best big-O estimate for the number of comparisons used by the algorithm that determines the number of 1s in a bit s

tring by examining each bit of the string to determine whether it is a 1 bit.
Mathematics
1 answer:
Westkost [7]3 years ago
5 0

Answer:

0(n)

Step-by-step explanation:

Result previous exercise:  

procedure count(a1a2...an : string with n > 1)

i:=0

for k:=1 to n

if ak =1 then i:=i + I

return i  

<em>Note</em><em>: If you use a different algorithm, then you could possible get different results.  </em>

<u>SOLUTION  </u>

There is only one part of the code that contains an operation (comparison), namely if a_k =1  

This comparison is executed in every iteration of the for-loop  

k can take on the values from 1 to n (for k:=I to n), thus k can take on n values.  

Thus in total there are then n comparisons, while n is 0(n).

You might be interested in
If there are 48 students in a school play the ratio of boys to girls is 5:7 how many more girls than boys are in the play?
Andreas93 [3]

Answer:

8

Step-by-step explanation:

5 + 7 = 12

48 / 12 = 4

5 x 4 = 20

7 x 4 = 28

There are 8 girls more than boys

8 0
3 years ago
Tammy has 4 times as many books as Willy . Willy has 180 fewer books than Tammy . How many books does Willy have ?​
enyata [817]

Answer:

60 books

Step-by-step explanation:

let the number of books Willy has be x , then

Tammy has 4x books

Willy has 180 fewer books , that is Tammy has 180 more than Willy , so

4x = x + 180 ( subtract x from both sides )

3x = 180 ( divide both sides by 3 )

x = 60

Thus

Willy has 60 books andTammy has 4 × 60 = 240 books

which is 180 more than Willy

7 0
2 years ago
12-<br> 8.<br> 2.<br> 4<br> 8<br> 10<br> Slope
S_A_V [24]

Step-by-step explanation:

what is the problem ? find the slope of the line ?

the slope is the ratio y/x of the y difference and the x difference between 2 points.

I see 2 points with seemingly integer coordinates.

one point is at (2, 6) as you marked it also on the sheet.

the other point is (6, 12).

so, when you go from point 1 to point 2, x changes by 4 units (from 2 to 6) and y changes by 6 units (from 6 to 12).

therefore, the slope is 6/4 = 3/2

5 0
3 years ago
Branliest! I need to not fail. :)
Pavlova-9 [17]

Answer:945 3099 0266945 3099 0266945 3099 0266945 3099 0266945 3099 0266945 3099 0266945 3099 0266945 3099 0266945 3099 0266

Step-by-step explanation:

7 0
3 years ago
Read 2 more answers
ANSWER ASAP GIVING BRAINLIEST AND STUFF!
never [62]

Answer:

You could make an organized list, sample space, table, or tree diagram.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Emi computes the mean and variance for the population data set 87, 46, 90, 78, and 89. She finds the mean is 78. Her steps for f
    9·2 answers
  • 1. A 1500 kg car starts at rest and speeds up to 3.0 m/s. The gain in kinetic energy is 6750 J.
    14·2 answers
  • How can you write 8.19 in word from
    11·2 answers
  • What is the answer to -14-24
    14·2 answers
  • What is the standard deviation of the data set? Round to the nearest tenth if needed.
    5·1 answer
  • Cam rode her bike 5 times as far as Dante did. Dante rode 197 meters farther than Michael did. Cam rode 10.25 kilometers. How ma
    8·1 answer
  • What is the value for x?<br> 69<br> (5x + 2)<br> Enter your answer in the box<br> (9y-3)
    14·1 answer
  • PLZ HELP WITH THIS QUESTION ASAP. 20 POINTS!!! Brainliest to best answer!! Please answer with detail and show ALL steps to how y
    6·1 answer
  • A coin will be tossed twice, and each toss will be recorded as heads (H) or tails (T).
    6·2 answers
  • Test |
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!