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
How do you do distributive property
Wittaler [7]
<span>In abstract algebra and formal logic, the distributive property of binary operations generalizes the distributive law from elementary algebra. In propositional logic, distribution refers to two valid rules of replacement. The rules allow one to reformulate conjunctions and disjunctions within logical proofs.</span>
5 0
3 years ago
Read 2 more answers
*EXTRA POINTS*
SashulF [63]

Answer:

geometric sequence

ratio

2

3 0
3 years ago
What is the length of the arc intercepted by an angle of 10 degrees on a circle with a radius of 10 meters?
soldier1979 [14.2K]
   
\displaystyle\\&#10;\texttt{Length of the arc }= 2\pi R\times  \frac{10}{360} = \frac{2\pi \times 10}{36} = \frac{20\pi}{36} =  \boxed{\frac{5\pi}{9}~m}



3 0
3 years ago
Geometry help. abcd is a parallelogram
joja [24]
The first and the 2nd one are correct because x is 21 and y is 49
3 and 4 at wrong
6 0
3 years ago
I NEED HELP PICTURE PROVIDED!
Sav [38]
Question 2:
The answer is 21
The two angles are vertically opposite, which makes them equal and also means we can make an equation:
4x - 4 = 3x + 17
- 3x
x - 4 = 14
+ 4
x = 21

Question 3:
The answer is 23
Again, the angles are vertically opposite, so we can make them equal each other:
5x - 53 = 3x - 7
- 3x
2x - 53 = -7
+ 53
2x = 46
÷ 2
x = 23

I hope this helps!
7 0
3 years ago
Other questions:
  • To help give money to the homeless Alaska made an organization to spread awareness on homelessness and poverty for every new mem
    6·1 answer
  • Suppose you had 450$ in your account. What percent of money did you spend? Round your answer to the nearest percent
    8·1 answer
  • What is the number ?
    12·2 answers
  • A projectile is fired from a cliff 200 above the water at an inclination of 45 degree to the horizontal, with a muzzle velocity
    10·1 answer
  • Write the point-slope form of the line that passes through the points (-2, 1) and (0, 1). Identify (x1, y1) as (-2, 1).
    12·1 answer
  • A student finishes the first half of an exam in the time it takes him to finish the second half. If the entire exam takes him an
    5·1 answer
  • Yuki bought a pound of confetti for 12$. What is the price, in dollars, per ounce of confetti?
    5·1 answer
  • Which of the following does not represent a function? <br>​
    12·2 answers
  • Help me on this please:(
    5·1 answer
  • A large tank is partially filled with a solution. The tank has a faucet that allows solution to enter the tank at a rate of 16 3
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!