Optimization Topics/Exercise 06

From Wiki**3

< Optimization Topics
Revision as of 18:10, 2 June 2012 by Root (talk | contribs) (Created page with "Considere a seguinte função em C: <c> int main() { int a[10], i = 1; a[0] = 0; while (i < 10) a[i++] = a[i-1] + 2 * i - 1; return 0; } </c> # Identifique os...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Considere a seguinte função em C:

<c> int main() {

 int a[10], i = 1; 
 a[0] = 0; 
 while (i < 10)
   a[i++] = a[i-1] + 2 * i - 1; 
 return 0; 

} </c>

  1. Identifique os blocos básicos.
  2. Que optimizações poderiam ser efectuadas?