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
No one answered it last time :(
azamat

Answer:

Step-by-step explanation:

The perimeter is 28".

The total length of three sides of the square = 28-5-5 = 18", so the side length of the square is 18/3 = 6".

The area of the triangle is ½(6)(4) = 12 square inches.

The area of the square is 6² = 36 square inches.

Total area = 12+36 = 48 square inches.

5 0
3 years ago
Solve These Number Patterns:
irina [24]
1) -512, 1024, -2048. You just multiply by -2.
2)7.8125, -3.9062, 1.9531. You divide by -2
4 0
4 years ago
What expressions are equivalent to 3(n+6)
KengaRu [80]
3n+3*6 which simplifies to 3n+18
8 0
4 years ago
6)<br> Simplify: -61 A<br> -10x - 24<br> B<br> - 10x + 24<br> -10x + 4<br> 31<br> D)<br> -10x - 4
m_a_m_a [10]
I think it’s gonna be C.
8 0
3 years ago
<img src="https://tex.z-dn.net/?f=%20%5Csqrt%5B3%5D%7B4%28%20%5Csqrt%5B3%5D%7B6%20%2B%20%20%5Csqrt%5B3%5D%7B10%29%7D%20%7D%20%7D
irinina [24]

Answer: 77824

Step-by-step explanation:

7 0
3 years ago
Other questions:
  • Solve the expression using the order of operation: Find the hypotenuse of a right triangle if the legs are 8cm and 5cm by using
    12·1 answer
  • Could some one help me with this problem? 13 - 8.1 =
    7·2 answers
  • Square root 32x^10y^n simplifies to (4x^5y^3 square root 2y) what is the value of n?
    11·1 answer
  • Find the future value (FV) of the annuity due. (Round your answer to the nearest cent.) $175 monthly payment, 7% interest, 11 ye
    9·1 answer
  • If x equals 7, then find the matching value for y.<br> -2x-2y=-2
    5·1 answer
  • A mule deer can run one over four of a mile in 25 seconds. At this rate, which expression can be used to determine how fast a mu
    9·1 answer
  • Trying to understand long division formula. 5 divided by 285.I have it down to 28-25 and i have 035 but why is 35 subtracted by
    10·1 answer
  • Write an equation to solve for x. (DO NOT SOLVE)<br> 75°<br> x + 53<br> x + 68
    13·1 answer
  • Which of the graphs below represent a function?
    10·1 answer
  • Simplify.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!