Advertisement
KillerBananaZ

Tehnici de programare recapitulare

Jun 7th, 2017
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1.     Tehnici de programare
  2.  
  3. 1) Metoda Divide-et-impera
  4. 2) Metoda Backtracking
  5. 3) Metoda Greedy
  6. 4) Programare dinamica
  7.  
  8. divide(int li,int lf)
  9. {
  10.     if(li==lf)
  11.     // daca problema are rezolvare directa atunci se rezolva problema
  12.     else
  13.     {
  14.         // se determina mijlocul
  15.         int mij=(li+lf)/2;
  16.         divide(li,mij);
  17.         divide(mij,lf);
  18.         //se combina solutiile
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement