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
Please help...trying to help my son with Alegebra, but it's been 30 years.
xz_007 [3.2K]
Wait it says ur in high school so u can't be over 30. that isn't possible. So what's the problem here? not good at math.
7 0
3 years ago
Whats 0.2 divide by 0.4 work and answer
alexdok [17]
Its is two since you take out the decimals then divide regularly
3 0
3 years ago
Read 2 more answers
IF THIS QUESTION IS EASY MAKE ME BRILLIST WHAT IS 10 X 6 ?
Dmitriy789 [7]

Answer:

its 60

Step-by-step explanation:

please mark brainliest

6 0
3 years ago
Read 2 more answers
ellen has a coupon for 1.55 off a loaf of bread. the regular price of the bread is 4.63. the loaf is cut into 14 slices. what is
AlexFokin [52]

Answer:

$0.22

Step-by-step explanation:

Ellen has a coupon of 1.55 off a loaf of bread

The regular price of the bread is 4.63, the loaf is cut into 14 slices

Therefore if she uses her coupon the price per slice can be calculated as follows

= 4.63-1.55

= 3.08

3.08/14

= 0.22

Hence the price is $0.22

3 0
3 years ago
Ali has 41 miles remaining after 32 minutes of driving how many miles over remaining after 40 minutes of driving with the slope
algol [13]
Thrhjbh hbyvg hbj If fur y fycfirst. If Guggenheim. Ugcfu ggu cig gug gfu. Fury y fry. Dttcdtdc tdtdcdtctddtctdtcdtdcdtcdct txcdtd txtctdtd ya. Ya txt. Stay z did tts d to start d
8 0
3 years ago
Other questions:
  • The vertex of parabola is (2,-2) Another point on the parabola is (5,7). find another point on the parabola.
    8·1 answer
  • Square root to a 100
    7·1 answer
  • Is -3 greater than -7
    10·2 answers
  • The topping are nuts hot fudge caramel and sprinkles
    14·1 answer
  • √x+4=√3x <br><br> A.) x=2<br> B.) x=-2<br> C.) x=3<br> D.) x=-3
    6·2 answers
  • potassium is a metal and chlorine is a nonmetal. if these two elements were to bond, they would form a(n) ionic compound covalen
    5·1 answer
  • A ghost crab can travel about 12 miles every 6 hours on the ocean’s floor. How far can the crab travel in 11 hours? Explain how
    8·1 answer
  • Help I’m really confused and I don’t understand it
    7·2 answers
  • Find the rule and the graph of the function whose graph can be obtained by performing the translation 4 units right and 3
    9·2 answers
  • A cyclist rides his bike at a rate of 18 miles per hour. What is this rate in kilometers per hour? How many kilometers will the
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!