Peterson's mutual exclusion algortihm for two processes is shown in Figure 12.34.
(a) Show that it satisfies mutual exclusion, progress, and bounded waiting.
(b) Use this algorithm as a building block to construct a hierarchical mutual exclusion algorithm for an arbitrary number of processes. (Hint: use a logarithmic number of steps in the hierarchy.)