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...")
 
 
Line 1: Line 1:
Considere a seguinte função em C:  
#REDIRECT [[ist:Optimization Topics/Exercise 04]]
<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.

Latest revision as of 18:19, 6 December 2018