answer.
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]
1 year 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]1 year 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
Three friends are buying seashells at the gift shop on the beach. Melanie buys 2 seashells for​ $0.80. Rosi buys 5 seashells for
bulgar [2K]

Answer:

Step-by-step explanation:

6 0
1 year ago
mia uses triangle A and says the slope of this line is 6/4.Elena use triangle B and say no,the slope is 1.5
Mekhanik [1.2K]

Incomplete question.

5 0
1 year ago
nikki backyard is in the shape of a rectangle. the length is 27 feet. The width is one-third the length plus 4 feet. write and e
PIT_PIT [208]

Answer:

A= Length x Width

A= 27 x (1/3 x 27 + 4)

A=27 x (9 + 4)

A= 27 x 13

A= 351

Step-by-step explanation:

ye

4 0
1 year ago
The sampling distribution of certain statistical measures shows a normal distribution which of the following is an unbiased esti
svlad2 [7]

Answer:

A) Proportion.

Step-by-step explanation:

The distribution of sample proportions leads or may tends to approximate a normal distribution and is an unbiased estimator that has a graph that is usually distributed and is not skewed. In other words, simply, we can also say that the population proportion is basically defined to be as the mean of the sample proportion. The population proportion is basically equaled the expected value of the sample proportion.

4 0
1 year ago
Read 2 more answers
A store makes a profit of $18 on a blanket after a markup of 30%. What is the selling price of the blanket?
Sidana [21]
$23.40 because 18•0.3=5.4 and 18+5.4=23.4.
6 0
2 years ago
Read 2 more answers
Other questions:
  • Which two-bedroom will cost the most to rent monthly assume that electric is $50 and gas is $69?
    7·1 answer
  • Which expression is equivalent to sin7pi/6?
    11·2 answers
  • Turkey sandwiches cost $2.50 and veggie wraps cost $3.50 at a snack stand. Ben has sold no more than $30 worth of turkey sandwic
    6·2 answers
  • How many 2/5 cup servings are in 9/5 cups of ice cream
    15·2 answers
  • Students who party before an exam are twice as likely to fail as those who don't party (and presumably study). If 20% of the stu
    11·1 answer
  • A group of high school seniors took a scholastic aptitude test. The resulting math scores had a mean 504.7 with a standard devia
    11·1 answer
  • 21. A college professor recorded the speed with which students ran out the door after class after taking the final exam (using a
    7·1 answer
  • David wants to rent a bicycle for a couple of hours to explore the city. The price of the bike rental, (P)(P)left parenthesis, P
    5·1 answer
  • A taxi charges a flat rate of $3.00 plus $1.50 per mile. If Xander has $45.00, which inequality represents m, the distances in m
    6·2 answers
  • Paano mo nalaman Ang Tama o Mali sa sitwasyong ito<br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!