How to solve this algorithm, math homework help

How to solve this algorithm, math homework help

Consider the following algorithm.

for i is in {1, 2, 3, 4, 5} do
beep
for

j is in {1, 2, 3}

do

beep
for

k is in {1, 2, 3, 4}

do

for

l is in {1, 2, 3, 4}

do

beep
for

m is in {1, 2, 3, 4, 5, 6}

do

beep

How many times does a
beep statement get executed?

2. Consider the following algorithm.

x ← 1
for

i is in {1, 2, 3, 4}

do

for

j is in {1, 2, 3, 4, 5}

do

xx + x

for

k is in {1, 2, 3}

do

xx + 1

xx + 5

Count the number of + operations done by this algorithm.

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30


Click ORDER NOW..

order custom paper