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

x ← x + x

for

k is in {1, 2, 3}

do

x ← x + 1

x ← x + 5

Count the number of + operations done by this algorithm.