MIN = 2
MAX = 40
Maximum is obvious.
For Min -
Lets consider increment of count is in 3 micro instruction
step 1 Load Ri M[count]
step 2 INCR Ri
step 3 M[count] Ri
Where Ri is the local register allocated by each function called and used for temporary storage.
Lets called first A() is A1()
Second A() is A2()
Third A() is A3()
Fourth A() is A4().
Now every function from A1() to A4() will execute concurrently and each function will execute all 3 micro instruction;
1> Now consider A1() call first, it increment COUNT from 0 to 1 in 3 micro instruction but after executing 2 micro instruction and gets preempted so at this time the value of R1(temprrary register ) = 1 but the count value will be still 0.
2> Now let A2() and A3() complete the execution so count value will be 20.
3> A4() will start it execution and let it iterate for "9" times so the count value will be 29 and preempt the A4().
4> Let A1() will start it's execution and it will execute its 3 micro instruction and overwrite count value from 29 to 1 in it's first iteration and again preempt.
5> lets A4() start it's execution now the count value is 1 so it will iterate its 10 'th iteration and execute 2 micro instruction and then preempt A4(). at this time R4(temporary register = 2) and count = 1.
6> Now execute remaining iteration of A1 form i=2 to 10 so it will make count value as 10 and complete it's execution.
7>In final step A4() will start it's execution and will execute 3 micro instruction for 9'th iteration and overwrite count = 1 and in the 10 iteration it will increment count from 1 to 2 and finish the execution.
So Min = 2
Max = 40.