Date: Thursday, October 29, 2020.
Consider the following algorithm. Assume that all the variables have been declared beforehand. Analyze the dependencies between the different parts as highlighted, and build a dependency graph for it. Using the graph, figure out the critical path length and the degree of concurrency of this algorithm.
v = a + b; // 1
b = 2 * c; // 2
if (a > 0) // 3
n = 1; // .
else // .
n = 2; // .
m = n + 1; // 4
i = k[0]; // 5
j = i + n; // 6
if (m < i) // 7
k[1] = 10; // .
k{1] += v + b; // 8
k[2] = j - 1; // 9
k[3] = k[1] + k[2] // 10
Upload a file with the answers to Assignments, Exercise 3, or type it directly in the submission input box.