Prove this algorithm is correct
1 Mutual exclusion is preserved
2 The progress requirement is satisfied.
3 The bounded waiting requirement is met
Please point out which part of the code meets the condition and explain it
do {waiting[i] = true;key = true;while(waiting [i] && key)key = test_and_set (&lock);waiting [i] = false;// critical sectionj = (i+1)% n;while ((j !=i) && ! waiting [j]
j = (j+1) % n;
if (j = i)
lock = false;
else
waiting [j] = false;
// remainder section
} while (true)