Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tehnici de programare
- 1) Metoda Divide-et-impera
- 2) Metoda Backtracking
- 3) Metoda Greedy
- 4) Programare dinamica
- divide(int li,int lf)
- {
- if(li==lf)
- // daca problema are rezolvare directa atunci se rezolva problema
- else
- {
- // se determina mijlocul
- int mij=(li+lf)/2;
- divide(li,mij);
- divide(mij,lf);
- //se combina solutiile
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement