Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
aa:lab:7 [2025/11/16 12:09] aureliu.antonie add exercise 1 + 2 |
aa:lab:7 [2025/11/16 16:42] (current) aureliu.antonie add ex |
||
|---|---|---|---|
| Line 13: | Line 13: | ||
| * $ T_{Quicksort}(n) = T_{Quicksort}(n-1) + O(n) $\\ | * $ T_{Quicksort}(n) = T_{Quicksort}(n-1) + O(n) $\\ | ||
| Aceasta recurenta descrie [[https://en.wikipedia.org/wiki/Quicksort| Algoritmul Quicksort]] | Aceasta recurenta descrie [[https://en.wikipedia.org/wiki/Quicksort| Algoritmul Quicksort]] | ||
| + | * $math[T(n) = T(] $math[n \over 4] $math[) + T(] $math[3n \over 4] $math[) + n] \\ | ||
| 2. Folosiți una dintre cele 3 metode (metoda arborilor, metoda substituției, teorema master) pentru a rezolva recurențele: | 2. Folosiți una dintre cele 3 metode (metoda arborilor, metoda substituției, teorema master) pentru a rezolva recurențele: | ||
| - | * $ T_a(n) = 2T_a(\sqrt{n}) + \log n $ | + | * $ T_a(n) = T_a(\sqrt{n}) + 1 $ |
| - | * $ T_b(n) = \sqrt{n}T_b(\sqrt{n}) + n $ | + | * $ T_b(n) = 2T_b(\sqrt{n}) + \log n $ |
| + | * $ T_c(n) = \sqrt{n}T_c(\sqrt{n}) + n $ | ||
| <note> | <note> | ||
| Soluțiile acestui laborator se găsesc [[https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:sol:7|aici]] | Soluțiile acestui laborator se găsesc [[https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:sol:7|aici]] | ||
| </note> | </note> | ||