SE VINDE (500E)

Conspecte.roConspecte

Analiza algoritmilor MMC

CURSUniversitateUTMProfesorIon

preview iconExtras din document

Codul programului: #include #include int ct = 0; int ft_fibonacci(int index) { ct++; if (index 1 && index = 3 && index < 2178309) return (ft_fibonacci(index - 1) + ft_fibonacci(index - 2)); return (index); } int fib1(int index) { int counter = 0; int a = 0, b = 1, c, i; if( index == 0) return a; for (i = 2; i <= index; i++) { c = a + b; a = b; b = c; counter++; } printf("Iteratii %d\n", counter); return (b); } int fib2(int index) { int counter = 0; int f[index+2]; // 1 extra to handle case, n = 0 int i; f[0] = 0; f[1] = 1; for (i = 2; i <= index; i++) { f[i] = f[i-1] + f[i-2]; counter++; }

  • flag rom iconLimba
  • Romana
  • file docx iconFormat
  • docx
  • file weight iconMarimea
  • 88 Kb
  • upload iconAdaugat
  • 11.Oct.18
  • user iconAutor
  • yofu
  • download iconDescarcari
  • 0
Download
alert iconRaporteaza o eroare
0 Comenteaza
+1
Posteaza

Curs: Analiza algoritmilor Obiect: MMC

Contacte

mail iconconspecte@gmail.comskype logoconspectemail boxScrie mesaj administratiei
Copyright 2018 Conspecte.ro