Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. a) Identify the basic blocks for the following program P3 written in pseudo-code. b) Draw the control flow graph. c) Draw the dominator tree.
3.
a) Identify the basic blocks for the following program P3 written in pseudo-code.
b) Draw the control flow graph.
c) Draw the dominator tree.
d) Draw the postdominator tree.
Program P3
1) integer A, B;
2) input (A);
3)
4) if (A > 7)
5) B = 1;
6) else
7) {
8) B = 2;
9) if (A < 2) then
10) B = 3;
11) } // end else A>7
12)
13) for (i=1, i<=A, i++) loop
14) {
15) if (B<0) then
16) B = B + 4;
17) else
18) B = B - 5;
19) } // end for loop
20) output (A,B);
21) end;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started