Optimization Topics/Exercise 04: Difference between revisions
From Wiki**3
< Optimization Topics
(Created page with "Considere a seguinte função em C: <c> int find(int tab[], int max, int val) { int i; for (i = 0; i < max; i++) if (tab[i] == val) break; return i; } </c...") |
(No difference)
|
Revision as of 16:09, 2 June 2012
Considere a seguinte função em C: <c> int find(int tab[], int max, int val) {
int i; for (i = 0; i < max; i++) if (tab[i] == val) break; return i;
} </c>
- Identifique as optimizações independentes da máquina que são possíveis.
- Traduza para código Postfix optimizado a função acima.
- Identifique os blocos básicos.