Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aa:tema_1_2018 [2018/11/02 22:10] cmihaela created |
aa:tema_1_2018 [2018/11/06 19:25] (current) cmihaela |
||
---|---|---|---|
Line 4: | Line 4: | ||
''Responsabili tema'': Mihaela Catrina, Teodor Popescu | ''Responsabili tema'': Mihaela Catrina, Teodor Popescu | ||
- | * Pentru fiecare din recurentele urmatoare determinati o limitarea asimptotica stransa, in cazul in care teorema Master poate fi folosita. In caz contrar, argumentati de ce nu poate fi folosita teorema Master: | + | * I. (//0.5 x 6 = 3p//) Pentru fiecare din urmatoarele recurente aplicati teorema Master (sau argumentati de ce nu poate fi aplicata, daca este cazul): |
- | * $math[T(n) = T(n/2) + 2^n] | + | * $math[T(n) = T(\frac{n}{2}) + 2^n] |
- | * $math[T(n) = 2^nT(n/2) + n^n] | + | * $math[T(n) = 2^nT(\frac{n}{2}) + n^n] |
- | * $math[T(n) = 2T(n/4) + n^{0.51}] | + | * $math[T(n) = 2T(\frac{n}{4}) + n^{0.51}] |
- | * $math[T(n) = 64T(n/8) − n^2log n] | + | * $math[T(n) = 64T(\frac{n}{8}) − n^2log n] |
- | * $math[T(n) = T(n/2) + n(2 − cos n)] | + | * $math[T(n) = T(\frac{n}{2}) + n(2 − cos n)] |
- | * $math[T(n) = 16T (n/4) + n!] | + | * $math[T(n) = 16T(\frac{n}{4}) + n!] |
+ | |||
+ | |||
+ | * II. (//1p//) Determinati $math[f(n)] astfel incat $math[T(n) = \theta(f(n))]: | ||
+ | * $math[T(n) = \frac{1}{4}T(\frac{n}{4}) + \frac{3}{4}T(\frac{3n}{4}) + 1] | ||
+ | |||
+ | * III. (//1p//) Rezolvati urmatoarea recurenta, presupunand ca n este o putere a lui 2: | ||
+ | * $math[T(n) = \displaystyle\sum_{i=1}^{log_2n} T(\frac{n}{2^i}) + n] | ||
+ | |||
+ | * IV. (//2p//) Determinati $math[f(n)] astfel incat $math[T(n) = \theta(f(n))]: | ||
+ | * $math[T(n) = \sqrt{2n}T(\sqrt{2n}) + n^2] | ||
+ | |||
+ | * V. (//3p//) Analizati complexitatea urmatorului algoritm, | ||
+ | <code cpp> | ||
+ | s = 0; | ||
+ | for(i = 0; i < pow(2,n) ; i++) { | ||
+ | for(j = i; j > 0; j = f(i, j)) { | ||
+ | s++; | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | avand in vedere ca operatiiile aritmetice si operatiile pe biti (&) se realizeaza in timp constant, iar $math[pow(2,n) = 2^n], pentru cazul in care : | ||
+ | - <code> f(i,j) = (j-1) & j </code> | ||
+ | - <code> f(i,j) = (j-1) & i </code> | ||
+ | |||
+ | |||
+ | |||
+ | === PRECIZARI === | ||
+ | * Tema va fi redactata individual. | ||
+ | * Tema va fi predata la cursul din data de **23 noiembrie 2018**. | ||
+ | * Tema valoreaza **1** punct din nota finala. | ||
+ | |||
+ |