mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-02 06:46:18 -04:00
👾
This commit is contained in:
parent
1d44d182e2
commit
a85ed914d3
320 changed files with 0 additions and 0 deletions
37
math/README.md
Normal file
37
math/README.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
## math, logic, dynamic programming
|
||||
|
||||
<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
|
||||
python3 fibonacci.py
|
||||
|
||||
Testing fibonacci
|
||||
Fibonacci of 10: 55
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
```python
|
||||
python playing_with_math.py
|
||||
|
||||
Greatest common divider of 21 and 7 is 7
|
||||
Prime factors of 21 are [3, 7]
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue