This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Divide et impera versus Dynamic Programming | |
| f(5) | |
| f(4) f(3) | |
| f(3) f(2) f(2) f(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| //2 for-uri...O(n^2) | |
| //n * 2^n | |
| /* | |
| A = {1,2,3} numarul de submultimi = 8 pentru ca avem 2^3 subsets | |
| 1. backtracking | |
| 2. iterativ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Fibonacci Sequence | |
| //0,1,1,2,3,5,8,13,21, 34,.....infinit | |
| //Algoritmul Naiv | |
| //Big O Notation: O(2^n) | |
| /* | |
| long long fib_exponential(int n) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Sortare rapida: Quicksort | |
| Big O Notation: n log n | |
| v = [1,2,8,7,9]; | |
| Bubble Sort : O(n^2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Complexitatea Algoritmilor | |
| ------------------------- | |
| Prin complexitatea unui algoritm intelegem de fapt costul, masurat cu ajutorul unor anumiti parametri | |
| (timp de executie, memoria necesara, numarul de operatii). PEntru a calcula complexitatea unui algoritm , avem nevoie sa decidem | |
| care sunt acesti parametri si sa gasim o functie determinare a costului corespunzatoare. | |
| Notatii Teta 0, O, Omega |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| //Divide Et Impera | |
| double babylonianSquareRoot(double number) | |
| { | |
| if(number < 0) { | |
| cerr<<"Error: Cannot compute Square Root of a negative number."<<endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| using namespace std; | |
| //=============================================== | |
| // CLASA ABSTRACTA ANGAJAT | |
| //=============================================== | |
| class Angajat { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <map> | |
| using namespace std; | |
| int main() { | |
| map<int, string> studenti; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream>//cout,cin | |
| #include <fstream> //fstream | |
| #include <string> | |
| #include <map> | |
| //========================================================= | |
| // CLASA CARTE | |
| //========================================================= | |
| using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| import java.io.*; | |
| /* | |
| Se considera un triunghi de numere naturale format din n linii. | |
| Prima linie contine un numar, a doua linie doua numere...ultima linie n numere naturale. | |
| Cu ajutorul acestui triunghi se pot forma sume de numere naturale in felul urmator: | |