feat: add theory guides (terminology, algorithms, testing, debugging) and 2 new chapters
This commit is contained in:
1 parent
ae4c421815
commit
0ac80d60d4
14 files changed
+380
-3
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# 11 — Algorytmy i Złożoność Obliczeniowa (`O(log n)`, `O(n)`)
|
||||
|
||||
Teoria: [notes/03-algorithms-and-complexity.md](../../../notes/03-algorithms-and-complexity.md)
|
||||
|
||||
## Zadania (`algorithms.py`)
|
||||
1. `binary_search(sorted_nums: list[int], target: int) -> int | None` — wyszukiwanie binarne w `O(log n)` (zwróć indeks lub `None`).
|
||||
2. `two_sum(nums: list[int], target: int) -> tuple[int, int] | None` — znajdź parę indeksów `(i, j)` (`i < j`) dającą `nums[i] + nums[j] == target` w czasie `O(n)` przy pomocy `dict`.
|
||||
3. `is_palindrome(text: str) -> bool` — sprawdź palindrom metodą **dwóch wskaźników** (*two pointers*), ignorując wielkość liter i znaki niebędące literami/cyframi.
|
||||
4. `max_window_sum(nums: list[int], k: int) -> int | None` — maksymalna suma spójnego podciągu długości `k` metodą **okna przesuwnego** (*sliding window*) w `O(n)`.
|
||||
|
||||
## Uruchomienie testów
|
||||
```bash
|
||||
make test MOD=01-core/11-algorithms
|
||||
```
|
||||
Reference in new issue
Block a user