mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-06-16 10:59:13 -04:00
Update README.md
This commit is contained in:
parent
24df4c93d7
commit
90ef21f8be
1 changed files with 17 additions and 0 deletions
|
@ -2,6 +2,23 @@
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
### dynamic programming
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
* take a recursive algorithm and cache overlapping problems (repeated calls).
|
||||||
|
* the runtime is given by the number of calls.
|
||||||
|
* **top-down**: how can we divide the problem into sub-problems?
|
||||||
|
* top-down dynamic programming is called **memoization**.
|
||||||
|
* **bottom-up**: solve for a simple case, then figure out for more elements.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### examples
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
```python
|
```python
|
||||||
python3 fibonacci.py
|
python3 fibonacci.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue