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
Lelechka [254]
3 years ago
15

A. Consider the following algorithm segment: for i := 1 to 4, for j := 1 to i, [Statements in body of inner loop. None contain b

ranching statements that lead outside the loop.] next j, next i. How many times will the inner loop be iterated when the algorithm is implemented and run?
b. Let n be a positive integer, and consider the following algorithm segment: for i := 1 to n, for j := 1 to i, [Statements in body of inner loop. None contain branching statements that lead outside the loop.], next j, next i. How many times will the inner loop be iterated when the algorithm is implemented and run?
Mathematics
1 answer:
yuradex [85]3 years ago
6 0

Answer:

(a) 4i times

(b) "i × n" times

Step-by-step explanation:

(a) Given the algorithm segment;

       for i := 1 to 4,  (Outer loop)

            for j := 1 to i   (Inner loop)

            next j,

       next i

The inner loop runs for i times, while the outer loop runs for 4 times.

The total times the inner loop would run when the entire algorithm is run is:

      = i × 4

      = 4i times

(b) Given the algorithm segment;

     for i := 1 to n,  (Outer loop)

            for j := 1 to i   (Inner loop)

            next j,

      next i

Where n is a set of positive integers.

The inner loop runs for "i" times, while the outer loop runs for "n" times.

The total times the inner loop would run when the entire algorithm is run is:

      = i × n

      = "i × n" times

You might be interested in
Isabelle went hiking. She climbed part way up a mountain and stopped to have lunch. Then, she climbed to the top. She took sever
jarptica [38.1K]
A line graph. The amount of time to do those things relates more to a line graph
4 0
3 years ago
Identify the percent of change as an increase or a decrease. 50 pounds to 35 pounds
mojhsa [17]

Answer:

There is a 30% decrese.

Step-by-step explanation:

6 0
2 years ago
Find the slope and y-intercept<br><br> b. y = 1/4x - 6
muminat

Answer:

Slope:  1/4

y-intercept: -6

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
Please help me with both the questions ty.
Tatiana [17]

Answer:

4) 26+4/842-/×375-^×

5)/^9+37+×+454+12

Step-by-step explanation:

6 0
2 years ago
Brainiest for An Actuate answer
const2013 [10]

Answer:

cos(x)=\frac{8}{17}

Step-by-step explanation:

The ratio will remain the same because all the sides will be equally increased. The angles will also remains the same.

Best Regards!

5 0
3 years ago
Other questions:
  • You are designing a birdhouse. You would like this birdhouse to look like a miniature version of the house you live in. You plan
    6·1 answer
  • How to find degrees in triangle using trig?
    6·1 answer
  • Look at the picture attached
    5·1 answer
  • 51 is 85% of what number?<br><br>A) 1.67<br>B) 51<br>C) 60<br>D) 43.35
    6·2 answers
  • What is two solutions for x&gt;6
    8·1 answer
  • Solve the equation | -2 x 5 |
    7·1 answer
  • The measure of an angle is 61°. What is the measure of its supplementary angle?​
    7·1 answer
  • Combine like terms.<br> 9y2 + 9(7y2-5) =<br> I need this for now please
    8·1 answer
  • ABCD is a rectangle. Find the length of segment AC
    12·1 answer
  • Please and Thank You ​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!