the c shellsort() function takes an array of gap values as a parameter. the array must contain a gap value of to guarantee proper sorting.

Answers

Answer 1
Answer:

If the collection of gap values contains 1, ShellSort will correctly sort an array using that collection. the InsertionSort method The normal insertion sort is identical to interleaved with a gap of 1.

How does Shellsort work?

An expanded variant of the insertion sort algorithm is shell sort. In order to lessen the distance between the components to be sorted, it first sorts those that are far apart from one another. Based on the chosen sequence, the space between the pieces is compressed.

What is gap size in shell sort?

We start by selecting a gap size, which establishes the distance between the values in a subsequence. In the case of a starting gap size of 6, for instance, the first subsequence would contain values at positions 1, 7, 13, 19, and so forth, whereas the second subsequence would contain values at positions 2, 8, 14, 20, and so forth.

To know more about Shellsort visit:                     brainly.com/question/23609675

#SPJ4


Related Questions

Suppose the target range for the federal funds rate is 1.5 to 2 percent but that the equilibrium federal funds rate is currently 1.7 percent. Assume that the equilibrium federal funds rate falls (rises) by 1 percent for each $120 billion in repo (reverse repo) bond transactions the Fed undertakes. If the Fed wishes to raise the equilibrium federal funds rate to the top end of the target range, will it repo or reverse repo bonds to non-bank financial firms? How much will it have to repo or reverse repo?
You are head of the Schwartz Family Endowment for the Arts. You have decided to fund an arts school in the San Francisco Bay area in perpetuity. Every 3 ​years, you will give the school $ 1 comma 000 comma 000. The first payment will occur 3 years from today. If the interest rate is 10.1 % per​ year, what is the present value of your​ gift?
Find the account balance at the end of the second period for $3,000.00 invested at 9% compounded quarterly.
At December 31, 2017 the following balances existed on the books of Vaughn Manufacturing: Bonds Payable $5990000 Discount on Bonds Payable 850000 Interest Payable 155000 If the bonds are retired on January 1, 2018, at 102, what will Vaughn report as a loss on redemption? $969800 $1124800 $814800 $599000
Sarah recently bought a bicycle. After a few days of cycling, she realized that she needed a basket on the bicycle to keep her bag and other items while cycling. Sarah's need of a basket is a _____.

You purchase a raffle ticket to help out a charity. The raffle ticket costs $5. The charity is selling 2000 tickets. One of them will be drawn and the person holding the ticket will be given a prize worth $4000. Compute the expected value for this raffle.

Answers

Answer:

-$3

Explanation:

Data provided in the question:

Cost of raffle ticket = $5

Number of tickets sold = 2000

Probability of winning = 1 ÷ 2000 = 0.0005

Winning prize = $4,000

Now,

The expected value of prize =  Probability of winning × Winning prize

= 0.0005 × $4,000

= $2

Therefore,

The expected value for this raffle

= expected value prize - Cost of raffle ticket

= $2 - $5

= -$3

Many demographers predict that the United States will have zero populationgrowth in the twenty-first century, in contrast to average population growth of about 1percent per year in the twentieth century. Use the Solow model to forecast the effect ofthis slowdown in population growth on the growth of total output and the growth ofoutput per person. Consider the effects both in the steady state and in the transition between steady states

Answers

Answer:

Check the explanation

Explanation:

  • The foremost thing is to first consider steady states. The Sluggish population growth rate swings in the line representing population growth and depreciation to the downward trend.
  • The new stable rate has a superior level of capital per worker thereby having a higher level of output per worker.
  • In Steady state, the entire output develops at rate n, whereas the output rate per worker grows at figure 0. Hence, slower population growth will hamper the figure of total output growth, but the rate of per-worker output growth will be the same.
  • Now reflect on the transition. We know that the constant-state level of output per worker is higher with little population growth. Hence, for the period of the transition to the new steady state, output per worker should grow at a rate faster than 0 for a sometime.

Which statement is an objection of using the Consumer Price Index (CPI) to measure changes in the cost of living

Answers

Complete Question:

Which of the following is an objection of using the Consumer Price Index (CPI) to measure changes in the cost of living?

A. The calculated inflation rate is only accurate for an individual who purchases all the goods and services in the basket.

B. The inflation rate is always understated due to substitution bias.

Answer:

Consumer Price Index (CPI)

A. The calculated inflation rate is only accurate for an individual who purchases all the goods and services in the basket.

Explanation:

To obtain the Consumer Price Index (CPI), a predetermined basket of consumer goods and services is obtained.  Weights are assigned to the goods according to their relative values in the basket.  The price changes are calculated.  The resulting figures  are averaged to determine the CPI.

Answer:

The calculated inflation rate is only accurate for an individual who purchases all the goods and services in the basket.

Explanation:

The leader of two postpartum women's support groups is interested in the depression levels of the women in her groups. She administers the Center for Epidemiologic Studies Depression Scale (CES-D) screening test to the members of her groups. The CES-D is a 20-question self-test that measures depressive feelings and behaviors durin the previous week. The mean depression level from the screening test for the 6 women in the first group is mu_1 = 16; the mean depression level for the 10 women in the second group is mu_2 = 12. Without calculating the weighted mean for the combined group, you know that the weighted mean is: Midway between 16 and 12 Closer to 16 than to 12 Closer to 12 than to 16 Compute the weighted mean. Enter your answer rounded to one decimal place. mu = The support group leader realizes that she should also screen for alcohol abuse, so she gives the women in her two groups the Michigan Alcohol Screening Test (MAST). The MAST is a 22-question self-test focusing on the use and abuse of alcohol. The first group has a mean score of mu_1 = 18. The second group has a mean score of mu_2 = 14. Compute the weighted mean. Enter your answer rounded to one decimal place. mu =

Answers

The mean depression level  for the first group is μ₁= 16.

The mean depression level for the second group is μ₂ = 12

The weighted mean is closer to 12 than to 16.

The calculated weighted mean  for  CES-D is 13.5

The calculated weighted mean  for  MAST is 17.25 ≈ 17.0 rounded to 17.

Calculating the weighted mean μ

μ=   (w1x1 + w2x2)/(w1+w2)      {where x1 =μ₁ and x2= μ₂ }

μ= 16×6 + 10×12/ 6+10

μ= 216/16

μ= 13.5

The first group has a mean score of μ₁= 18.

The second group has a mean score of μ₂ = 14

Calculating the weighted mean μ

{where x1 =μ₁ and x2= μ₂ ; w1= number of women in the first   group and w2= number of women in the second group}

μ=   (w1x1 + w2x2)/(w1+w2)      

μ= 18×6 + 14×12/ 6+10

μ= 276/16

μ= 17.25≈ 17

brainly.com/question/23902866

brainly.com/question/23731238

The answer & explanation for this question is given in the attachment below.

The distribution of the amount of money spent by students for textbooks in a semester is approximately normal in shape with a mean of $235 and a standard deviation of $20. According to the standard deviation rule, how much did almost all (99.7%) of the students spend on textbooks in a semester?

Answers

Answer: $295

Explanation:

Given that,

Amount spent by the students is normal in shape

Mean = $235

Standard deviation = $20

99.7% is within 3 standard deviations of the mean:

= Mean + 3 × Standard deviation

= $235 + 3 × $20

= $235 + $60

= $295

The amount of $295 is spent by all the students on textbooks.

Stevenson Company purchased equipment for $250,000 on January 1, 2010. The estimated salvage value is $50,000, and the estimated useful life is 5 years. The straight-line method is used for depreciation. On July 1, 2013 Stevenson sold the equipment for $100,000. The journal entry to record the sale of the equipment will include.

Answers

Answer: The following journal entries would be recorded upon disposal of the equipment:

                                                                              Debit                       Credit

Cash                                                                   $100,000

Accumulated depreciation                               $140,000

Equipment                                                                                        $250,000

Loss on disposal of asset                                   $10,000

Explanation: Using the straight-line method of depreciation, the following formula applies: (Historical cost - Salvage value) / No of years

Depreciation = ($250,000 - $50,000) / 5 years = $40,000 yearly

Accumulated depreciation (January 1, 2010 - July 1, 2013) for three and half years is $140,000 (3.5 years * $40,000). This means that the equipment had a net book value (NBV) of $110,000 as at the time of disposal. So, the above entries would eliminate the asset in the books and recognise the loss on disposal (sales proceed was less than the NBV).