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]
2 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]2 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
Expressed as a percentage, how many more avocados does the city of
mash [69]

Answer:

In Phoenix they consume 60% more avocados than in Denver.

Step-by-step explanation:

Given that in Denver they consume 75 units of avocados, while in Phoenix they consume 120 units of said fruit, to determine the percentage difference between the consumption of both cities it is necessary to perform the following calculation:

75 = 100

120 = X

((120 x 100) / 75) = X

(12,000 / 75) = X

160 = X

160 - 100 = 60

Therefore, in Phoenix they consume 60% more avocados than in Denver.

8 0
2 years ago
For which pairs of functions is (f circle g) (x)?
iVinArrow [24]

Answer:

I just took the test and aint gon cap i guessed on it but the answer is B.

f(c)=2/x and g(x)=2/x

sorry I late but i thought i should still tell

Step-by-step explanation:

4 0
2 years ago
Read 2 more answers
A group of 75 math students were asked whether they like algebra and whether they like geometry. A total of 45 students like alg
Yuki888 [10]

Answer:

Step-by-step explanation:

Let x be the number of students that like both algebra and geometry. Then:

1. 45-x is the number of students that like only algebra;

2. 53-x is the number of students that like only geometry.

You know that 6 students do not like any subject at all and there are 75 students in total.

If you add the number of students that like both subjects, the number of students that like only one subject and the number of students that do not like any subject, you get 75.

Therefore,

x+45-x+53-x+6=75.

Solve this equation:

104-x=75,\\\\x=104-75,\\\\x=29.

You get that:

29 students like both subjects;

45-29=16 students like only algebra;

53-29=24 students like only geometry;

24+6=30 students do not like algebra;

16+6=22 students do not like geometry.

a = 29, b = 16, c = 24, d = 30, e = 22

<h3>The correct choice is D.</h3>

5 0
2 years ago
Read 2 more answers
Jonah was standing at an elevation somewhere between Negative 1 and one-half and Negative 2 and one-third meters with regards to
Agata [3.3K]

Options :

A number line going from negative 3 to positive 3 in increments of 1.

1 and StartFraction 5 Over 6 EndFraction meters

Negative 2 and StartFraction 3 Over 6 EndFraction meters

2 and StartFraction 3 Over 6 EndFraction meters

Negative 1 and StartFraction 5 Over 6 EndFraction meters

Answer:

Negative 1 and StartFraction 5 Over 6 EndFraction meters

Step-by-step explanation:

Jonah's position range :

Between - 1 1/2 meters and - 2 1/3 meters with respect to sea level

With regards to sea level and the range of position given ; Jonah's position will be below sea level, that is Jonah's position cannot be a positive location on the number line, thus all options with positive values are incorrect.

Hence Jonah's position will be any number on a number line located in between :

-2 1/3 and - 1 1/2

That is

-2 1/3 ≤ Jonah's location ≤ - 1 1/2

-2 1/2 ( this is less than - 2 1/3) (incorrect)

-1 5/6 lies in between the given range and is thus a possible position.

7 0
2 years ago
Johnny works on multiple jobs for his uncle. Johnny is paid a one-time fee of $245.00 for all of his jobs. His uncle also pays h
Ede4ka [16]

From the above problem, we can  create the equation:

P = 245 + 20 t

where P is the total payment that Johnny receives and t is the total time he worked

Given that P = 2245, so find for t:

2245 = 245 + 20 t

t = 100 hours

7 0
2 years ago
Other questions:
  • 77 million to 200.2 million
    9·1 answer
  • on a nearby pond, black and white ducks are swimming in groups of three. James wants to find the experimental probability of two
    9·2 answers
  • A professor has eight different tasks to assign, one to each of her eight teaching assistants. In how
    5·1 answer
  • You are a school photographer taking individual and class pictures for 2 classes of 21 students each. On average, each individua
    7·2 answers
  • Stanley has a collection of seashells. He found 35% of his collection on Florida beaches. If Stanley has 49 seashells from Flori
    10·1 answer
  • If the mixing container only holds 40 ounces of paint, then what is the most green paint the artist can make, and what recipe sh
    13·1 answer
  • Horatio is solving the equation Negative three-fourths + two-fifths x = StartFraction 7 Over 20 EndFraction x minus one-half. Wh
    11·1 answer
  • Jeanette really loves apple-flavored Fruity Tooty candies, but there always seems to be a lot of cherry-flavored candies in each
    12·2 answers
  • A rectangular tank measuring 35 cm by 28 cm by 16 cm is 2/5 filled with
    5·1 answer
  • What is the place value of the 3-digit in the number 11.321?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!