Let t[1..n] be a sorted array of distinct integers, some of which may be negative. give an algorithm that can find an index i such that 1 i n and t[i] = i

Answers

Answer 1
Assuming we need to find i such that 
1 ≤ i ≤ n  and t[i]=i.

If we need to find only the first occurrence, we can do:

for i:1 to n {
    if t[i]=i then return(i)
}

If exhaustive search is required, then put the results (values of i) in an array or a linked list, return the number of values found, and the array (or linked list).



Related Questions

Henry sells rings for $8 each. His expenses are $1.50 per ring, plus $91 for supplies. How many rings does he need to sell for his revenue to equal his expenses?

Answers

Answer:

14 rings.

Step-by-step explanation:

in order to calculate how many rings does he have to sell to break even we first have to calculate the profit that he has on the sell of every ring from which he can take money to pay per supplies, so that would be the selling price minues expenses:

8-1.5=6.5

Now we have to divide the 91 in supplies by the profit:

91/6.5=14

So he has to sell 14 rings in order to break even between expenses and supplies.

Henry needs to sell approximately 14 rings to cover his expenses, which include $1.50 per ring and $91 for supplies, with each ring priced at $8.

To find out how many rings Henry needs to sell for his revenue to equal his expenses, you can set up an equation.

Let's denote the number of rings he needs to sell as "x."

Revenue from selling x rings = Expenses

Revenue is calculated as the price per ring multiplied by the number of rings sold, which is $8x.

Expenses consist of the cost per ring and the supplies cost, which is $1.50x + $91.

So, the equation becomes:

$8x = $1.50x + $91

Now, let's solve for x:

Subtract $1.50x from both sides of the equation:

$8x - $1.50x = $1.50x + $91 - $1.50x

$6.50x = $91

Now, divide both sides by $6.50 to find the value of x:

x = $91 / $6.50

  ≈ 14

Therefore, Henry needs to sell approximately 14 rings for his revenue to equal his expenses.

Learn more about expenses here

brainly.com/question/29071730

#SPJ3

a total of 324 tickets were sold for the school play they were either adult tickets or student tickets the number of student tickets sold was three times the number of adults tickets sold how many adult tickets were sold?

Answers

The correct answer is 81

Final answer:

To find the number of adult tickets sold when a total of 324 tickets were sold for a school play and student tickets were three times the number of adult tickets, we set up the equation x + 3x = 324, solved for x, and found out that 81 adult tickets were sold.

Explanation:

The question is asking us to find out how many adult tickets were sold when a total of 324 tickets were sold for a school play, with the number of student tickets being three times the number of adult tickets sold. To solve this, we let x represent the number of adult tickets. Therefore, 3x will represent the number of student tickets since there are three times as many student tickets as adult tickets.

The equation representing the total number of tickets sold would be: x (adult tickets) + 3x (student tickets) = 324. Simplifying, we have 4x = 324. Dividing both sides by 4 gives us x = 81.

Therefore, the number of adult tickets sold is 81.

The cone in the diagram has the same height and base area as the prism. What is the ratio of the volume of the cone to the volume of the prism?

Answers

The volume of any "pointy" solid will be 1/3 that of the corresponding prism or cylinder (with same height and base area). The only caveat is that the slope of the sides of the pointy solid is constant.

For your figures: 1/3.

Answer:

B.   1/3

I had this question on Plato this is the answer.

Jennifer made 5 liters of punch for her party. Her brother made another 750 mL. If they combine the two batches, how many 180mL servings would they have? Would there be any punch left over? If so how much? Please respond with the answer of how much of the two batches combined and how many 180mL there are

Answers

we know that

1 liter----------------> 1000 ml
Jennifer punch is 5 liters----------------> 5*1000=5000 ml
Her brother punch-------------------------> 750 ml
[total two batches]=(5000+750)----------> 5750 ml

the answer part A) is 5750 ml

Part B) how many 180 mL servings would they have?
[180 mL servings]=5750/180=31.94-----------> 31 

they would have 31 (180 ml servings)
punch left over=[5750-31*180]=170 ml
there would  be 170 ml of punch left over

The area of a circle is 225 pie square inches. Find the area of the sector whose central angle is 45°.

Answers

Consider this option:
The central angle for whole circle is 360°, it means that angle 45° has 45/360=1/8 part of the circle.
If the area of the circle is 225π, then the area of the sector 45° is 225π/8≈28.125π (in.²)

answer: 28.125π in².

The area of the sector of the circle is 28.125π inches²

What is a Circle?

A circle is a closed two-dimensional figure in which the set of all the points in the plane is equidistant from a given point called “centre”. Every line that passes through the circle forms the line of reflection symmetry. Also, the circle has rotational symmetry around the centre for every angle

The total internal angle is 360° about the centre

The area of the sector of the circle = ( θ / 360° )πr²

The perimeter of circle = 2πr

The area of the circle = πr²

where r is the radius of the circle

Given data ,

Let the area of the circle be = A

The value of A = 225 inches²

Now , the area of the sector whose central angle is 45° is calculated by

The area of the sector of the circle = ( θ / 360° )πr²

Substituting the value for θ = 45° , we get

Area of the sector of the circle = ( 45/360 ) x 225

                                                    = ( 1/8 ) x 225

                                                    = 28.125 inches²

Therefore , the area of the sector is 28.125 inches²

Hence , The area of the sector of the circle is 28.125π inches²

To learn more about circle click :

https://brainly.com/question/28391204

#SPJ2

Finally, 43 is 5% of what number?

Use the simplified ratio to find the equivalent ratio with a numerator of 43.

Enter your answer in the box.

43 is 5% of __?




Answers

5% = 5/100 = 1/20

43 ÷ 1/20 = 43 * 20/1 = 860  ← answer

Final answer:

43 is 5% of 860.

Explanation:

To find out what number 43 is 5% of, we can set up a proportion where 5% (or 0.05 when written as a decimal) is equal to 43 over an unknown total number X.

The formula to calculate this is part = percentage  imes total, which in this case turns into 43 = 0.05 * X.

To solve for X, divide 43 by 0.05, giving us X = 43 / 0.05 which equals 860.

Therefore, 43 is 5% of 860.

The length of time that an auditor spends reviewing an invoice is approximately normally distributed with a mean of 600 seconds and a standard deviation of 100 seconds. what is the probability that an auditor will spend more than 12 minutes on an invoice?

Answers

Answer: 11.5% 

Explanation:


Since 1 minute = 60 seconds, we multiply 12 minutes by 60 so that 12 minutes = 720 seconds. Thus, we're looking for a probability that the auditor will spend more than 720 seconds. 

Now, we get the z-score for 720 seconds by the following formula:

[tex]\text{z-score} = \frac{x - \mu}{\sigma} [/tex]

where 

[tex]t = \text{time for the auditor to finish his work } = 720 \text{ seconds} \\ \mu = \text{average time for the auditor to finish his work } = 600 \text{ seconds} \\ \sigma = \text{standard deviation } = 100 \text{ seconds}[/tex]

So, the z-score of 720 seconds is given by:

[tex]\text{z-score} = \frac{x - \mu}{\sigma} \\ \\ \text{z-score} = \frac{720 - 600}{100} \\ \\ \boxed{\text{z-score} = 1.2}[/tex]

Let

t = time for the auditor to finish his work
z = z-score of time t

Since the time is normally distributed, the probability for t > 720 is the same as the probability for z > 1.2. In terms of equation:

[tex]P(t \ \textgreater \ 720) \\ = P(z \ \textgreater \ 1.2) \\ = 1 - P(z \leq 1.2) \\ = 1 - 0.885 \\ \boxed{P(t \ \textgreater \ 720) = 0.115}[/tex]

Hence, there is 11.5% chance that the auditor will spend more than 12 minutes in an invoice. 

The probability that an auditor will spend more than 12 minutes on an invoice is approximately 88.49%.

Calculate the probability an auditor will spend more than 12 minutes on an invoice using the Z-score formula for a normal distribution.

The probability that an auditor will spend more than 12 minutes on an invoice can be calculated using the Z-score formula for a normal distribution.

Calculate the Z-score: Z = (12*60 - 600) / 100 = -1.2.Find the probability corresponding to this Z-score using a standard normal distribution table. P(Z > -1.2) = 0.8849.Therefore, the probability that an auditor will spend more than 12 minutes on an invoice is approximately 88.49%.

Katherine practices skiing for 1 1/2 hours every day except Saturday and Sunday. She practices for four hours on Saturday and three hours on Sunday. How many hours does she practice in a week?

Answers

1 1/2 hours x 5 days  = 7 1/2 hours

4+3 +7 1/2 = 14 1/2 hours per week

how to discriminant of each quadratic equation then state the number and type of solutions. yall fr help me

Answers

Try this option.
Note, 1. the rules marked with blue colour, the solutions marked by red; 2. solutions are given shortly.

Final answer:

The discriminant of a quadratic equation determines the number and type of solutions.

Explanation:

The discriminant of a quadratic equation can help determine the number and type of solutions.

If the discriminant is greater than zero, there are two real solutions.

If the discriminant is zero, there is one real solution.

If the discriminant is negative, there are no real solutions.

What has an infinite number of points extending in opposite directions that has only one dimension

Answers

I believe it is a line 
Hello there!

The answer to your question is a line. A line infinitely extends in opposite directions and it has an infinite number of points. It only has one dimension.

Now because the question doesn't say 'extends infinitely' and it JUST SAYS 'has an infinite number of points, a line segment could be a correct answer too because points are infinitely small. Don't write this answer though because I know the answer your teacher is looking for is a 'line.'

I really hope this helps!
Best wishes :)

Last year, 120 new houses were built in a neighborhood. So far this year, 56 of them have been sold. How many new houses have been sold this year?

Answers

56 of them have been sold...
right?
if 5/6 of 120 new houses have been sold, 100 houses in total have been sold so far this year.

the price of a tablet was reduced from $250 to $200. By what percentage was the price of the tablet reduced? Please help me solve this.

Answers

(250-200)/250=20%
it doesn't interfere with 200.

which of the following shows an equivalent expression to (5 times 3)times 12 if only associative property was used to transform the expression

Answers

There are no choices for this question, but the correct answer would be to re-write the exact same phrase only putting a parentheses around 3×12 instead. The associative property says that you can group your multiplication problem in any order it without changing the value. If we are only applying The associative property then the order it is written in would remain the same. Only the grouping would change.

Associative Property states

A × (B ×C)=(A×B)×C=(A×C)×B

Now, we have to find equivalent expression of

 [tex](5 \times 3) \times 12 \\\\1.\rightarrow 5 \times (3 \times 12)\\\\2.\rightarrow (5 \times 12) \times 3\\\\3 \rightarrow 180[/tex]

Could someone help me with this?

Answers

Distributive property was the first property used in STEP 1, where -4 was distributed to -3x+ 2 resulting in the equation in STEP 1. Next in STEP 2, commutative property of addition no matter how 12x and 6x are arranged, when you add them together the result will be the same. 
*Take note that 12x and 6x are put together because they are like terms. 

For Steps 3 and 4, you will see that the addition property of equality was used in STEP 3. To keep the equation equal, you will add the same number on both sides.

STEP 4 uses Division property of Equality. Like Step 3, to keep both sides of the equation equal, you must divide both sides with the same number. It keeps the statement true by doing so. 

STEP 4 and 5 uses transitive property if you examine both as a whole. 
Transitive property assumes that if a = b and b = c, then a = c

If   18/18 (a) = 1 (b),  and x (c) = 18/18(a)  then, x (c) = 1 (b). 

On the surface of the moon, the value of g is 1.67 m/s2. What is the horizontal distance traveled during a 2.00-meter high jump if the jumper runs as at 20 miles per hour?

Answers

To solve this question, you need to find how long jump is. For 2m high with 1.67 m/s2 it would be:

h= 1/2 gt^2
2= 1/2 * (1.67) t^2
t^2= 1.67
t= 1.29

If the speed is 20 mph and the jump is 2 second, the distance traveled would be:
20 miles/ hour * 1.29 second * (1 hour/3600second)= 0.007179 miles

If you need to convert it to meter then: 0.007179 mile * 1609.34meter/ mile= 11.55 meter

Factor each expression: 5a-25

Answers

5a-25
= 5(a-5)

----------------------
5a-25 = 5(a - 5)

hope it helps

Where a is determined by the conditions x2 + y2 ≤ 1 and x + y ≥ 1?

Answers

See, pls, the attached picture, the area determined by the conditions marked by yellow lines.

what is the slope of the line represented by the equation below? y=-2/3x+3

Answers

Answer:

-2/3

Step-by-step explanation:

The slope is the coefficient of x: -2/3.

___

This tells you how much y changes when x changes by 1 unit. The slope is the change in y divided by the change in x.

Efetue as divisões X ao cubo+10x+29x+20:x ao quadrado+5x+4

Answers


                                x + 5
                           ---------------------------------
   x^2 + 5x + 4    | x^3 + 10x^2 + 29x + 20
                         -  x^3 +   5x^2 +   4x
                        ----------------------------
                                        5x^2 + 25x + 20
                                     -  5x^2 + 25x + 20
                                     -------------------------
                                                                 0

(x^3 + 10x^2 + 29x + 20) / (x^2 + 5x + 4) = x + 5

A population of 1200 leopards decreases by 12% per year. How many leopards will there be in the population after 6 years? Round your answer to the nearest whole number

Answers

12% of 1200 is 144, so subtract that. you get 1056. 12% of that is 126.72, so you subtract that. you get 929.28. 12% of that is 111.5136 and you subtract that. and so on and so forth. the answer would be 557.

the value of the building owned by two veterinarians went from 125000 to 117500. What is the percent decrease

Answers

The decrease:
125000 - 117500 = 7500

Percentage of decrease = 7500/125000 x 100 = 6%

identify the roots of -3x^3-21x^2+72x+540=0. State the multiplicity of each root.

Answers

y = -3(x^3 + 7x^2 - 24x -  180) Taking that three out makes your life a whole bunch easier.
y = -3*(x - 5)*(x+6)^2
(x - 1) has a multiplicity of 1 and (x + 6) has a multiplicity of 2 <<<=== answer
The graph can be found at wolframalpha 
google it.

A student is raising money for a homeless shelter. A local business agrees to donate an additional 20% of what the student raises, while a local politician also agrees to donate an additional 10% of what the student raises. If the student raises $600.00, how much will be donated?

Answers

Answer: the answer is $780.00


Step-by-step explanation:

$600.00 x .20 = $120.00

$600.00 x .10 = $60.00

Total:

$600.00 + $120.00 + $60.00 = $780.00

Answer:

780

Step-by-step explanation:

A grandmother deposited $4,000 in an account that pays 5% per year compounded annually when her granddaughter was born. What will the value of the account be when the granddaughter reaches her 13th birthday?

Answers

A = P (1 + r/n)^nt
A = 4000(1 + 0.05/1)^(13)(1)
A = $7542.59

The value of the account is $7542.59.

What is interest?

It is computed by adding the annual interest rate raised to the number of compound periods and subtracting one after multiplying the initial principal amount by one. The resulting value is subsequently deducted from the loan's entire original amount.

Given:

P=4000

r = 5%

t = 13 years

Now, using the formula

[tex]A = P( 1 + r/n)^{nt}[/tex]

A = 4000[tex](1 + 0.05/1)^{(13)(1)[/tex]

A= 4000[tex](1.05)^{13[/tex]

A = 4000 x 1.8856

A = $7542.59

Hence, The value of the account is $7542.59.

Learn more about interest here:

https://brainly.com/question/13324776

#SPJ2

(Multiple Choice Worth 4 points) (05.01)A flower bed is in the shape of a triangle, with a base of 13 feet and a height of 5 feet. What is the area of the flower bed?


A 18 square feet
B 32.5 square feet
C 65 square feet
D 130.5 square feet

Answers

Hey there!

So, when finding area, we need to remember that the key point if this is to (multiply).

We would need to make sure that we do not get confused with (perimeter) and area.

We are going to multiple, sense the question stated "What is the area of the flower bed?".

To begin, what are the [tex](formula) [/tex] that we would use?

We will use . . .           [tex] \left[\begin{array}{ccc}\boxed{A= \frac{ h_{b}b }{2}} \end{array}\right] [/tex]

By using this, we would plug in the numbers to get your area.

[tex] \left[\begin{array}{ccc}\boxed{\boxed{13*5=65/2=32.5}}\end{array}\right] [/tex]

Your correct answer would be (option B)

[tex]\boxed{32.5} \ square \ feet[/tex]

I hope this helps you!


Answer:

b

Step-by-step explanation:

Ms Cohen gave a riddle: A string is 2 meters longer than a rod. Half of the rod is 1 meter shorter than half of the string. Is this true or false?

Answers

We are going to define the following variables.
 y: length of the string.
 x: length of the rod.
 We have the following equation:
 y = x + 2
 Half of the rod is 1 meter shorter than half of the string
 x/2 = y/2-1
 Let's rewrite equation 1 to see if it's true:
 y = x + 2
 (1/2) * y = (1/2) * (x + 2)
 (1/2) * y = (1/2) * x + 1
 (1/2) * x = (1/2) * y-1
 Answer
 this is true
 (1/2) * x = (1/2) * y-1

Rhoads earned $324.65 delivering newspapers. She promised her sister 0.2 of her earnings for helping her.How much does Rhoads owe her sister?


Do I have to subtract?? if not help me solve plz

Answers

In math problems, "of" usually means "multiplied by."

(owed to sister) = 0.2*(earnings)
.. = 0.2*$324.65
.. = $64.93

Rhoads owes her sister $64.93.

Mr. jones has two children. the older child is a girl. what is the probability that both children are girls?

Answers

Since we already know that the older child is a girl (a 100% chance to be a girl), there must be a 50% chance that the other child is a girl. Therefore, the probability that both children are girls is 50%.
Hope this helps!

Final answer:

Given that the older child is already a girl, the probability that both children of Mr. Jones are girls is 50%, assuming an equal chance of having a boy or a girl.

Explanation:

The question is asking about the probability that both children of Mr. Jones are girls, knowing that the older child is already a girl. Since the older child is a girl, we only need to consider the probability that the second child is a girl. In a typical scenario where the probability of having a boy or a girl is equal (assuming a 50% chance for each), the probability that the second child is a girl, given that the family already has one girl, is simply 0.5 or 50%. Therefore, in this case, the probability that both children are girls is 50%.

A website is offering a promotion, during which customers can buy up to 100 photos for a flat fee. The cost per photo varies inversely with the number of photos a customer buys, as shown in the table below. What functions model the data?

Answers

the complete question in the attached figure

we have that
 for c=5 and n=20------------> n*c=20*5=100
 for c=2.5 and n=40------------> n*c=40*2.5=100
 for c=2 and n=50------------> n*c=50*2=100
 for c=1.25 and n=80------------> n*c=80*1.25=100

therefore
the function that models the data is n*c=100

the answer is nc=100





Your answer is nc=100

Please help me with question 26

Answers

Answer: B) 65 degrees

-----------------------------------------------------

angle AEB = angle GEC
5x = 3x+10
5x-3x = 10
2x = 10
x = 5

angle GEC = 3x+10
angle GEC = 3*5+10
angle GEC = 25 degrees

Angle FEG = 90 - (angle GEC)
Angle FEG = 90 - 25
Angle FEG = 65 degrees

Other Questions
According to mill, what should education strive to instill in individual human beings? Please help me with questions 24, 25, 26 Preschoolers are not completely egocentric, and they can exhibit some understanding of conservation. this indicates that piaget may have underestimated the Historically, Americans are less likely to vote in non-presidential elections. Please select the best answer from the choices provided T F A mental desire or craving to achieve the effects produced by a drug is called _____.a. drug dependenceb. drug addictionc. psychological dependenced. psychological addiction Use the quadratic formula to determine the exact solutions to the equation.x^22x4=0Enter your answers in the boxes.x=__ or x=___ Convert. Into degrees How many types of vegetation are there in what is known as "The Land of Fire"? A car maintains a speed of 23 mi/h for 5 seconds. It then accelerates to a speed of 46 mi/h in 5 seconds. It maintains that speed for the next 5 seconds. Which graph shows the cars speed over time?(80 points) Americans produced an abundance of goods and services because of __________________ and __________________ . why is one half of the Box wider than the other half of the box check my answers1. What made the gods want to create Earth? (1 point)They were tired of living in darkness.They thought it would be a nice gift for Earth Goddess.>>> They saw the monster moving on the water.They were ashamed and needed to create something.2. What did Nanahuatzin and Tecuciztecatl agree to do? (1 point)to make amends to the weeping goddessto gather with the other gods in Teotihuacnto build a fire at Teotexcalli>>> to become the sun and the moon You have been appointed to a health education team at your school. Your job is to develop the criteria for the health information you will be sharing with students. Which term BEST represents your role in the project?A.critical thinkerB.problem solverC.effective communicatorD.self-directed You see the latest cell phone in the store, and you want it. You have enough money to pay the _____ of the phone, so you buy it.a.revenueb.pricec.profit A provider is performing an experimental cervical sympathectomy on a patient with raynaud's syndrome. what cpt and icd-10-cm codes are reported? Ling must spend no more than $40.00 on decorations for a party. She has spent $10.00 on streamers and wants to buy bags of balloons as well. Each bag of balloons costs $2.50. The inequality below represents x, the number of bags she can buy given the spending limit and how much she has already spent on streamers.10+2.5X_ Complete the statement If x/7 = 5/3, then x+7/7 =? what is the approximate distance between the points (-5 1) and (-2 3) on a coordinate grid A machine that fills bottles with a beverage has a fill volume whose mean is 25.01 ounces, with a standard deviation of 0.02 ounces. a case consists of 24 bottles randomly sampled from the output of the machine. find the standard deviation of the total volume of the beverage in the case. Many Head Start programs have a community aide who A. tutors at-risk children in the home. B. gives families the money they need to survive. C. connects families to community resources they need. D. represents families at family/teacher conferences.