|
You are here |
cp-algorithms.com | ||
| | | | |
lukesingham.com
|
|
| | | | | Grokking Algorithms is a beautifully formatted book that explains complex material simply using pictures, analogies and high level practical explanations. This post is a review and summary of the Grokking Algorithms book. | |
| | | | |
henrikwarne.com
|
|
| | | | | I recently finished the Coursera course Algorithms: Design and Analysis, Part 2 by Professor Tim Roughgarden of Stanford.I've already reviewed part 1, and here are my thoughts on the second part. The main theme of part 1 was the divide and conquer paradigm. In the second part the main themes were greedy algorithms, dynamic programming... | |
| | | | |
www.oranlooney.com
|
|
| | | | | A common example of recursion is the function to calculate the \(n\)-th Fibonacci number: def naive_fib(n): if n < 2: return n else: return naive_fib(n-1) + naive_fib(n-2) This follows the mathematical definition very closely but it's performance is terrible: roughly \(\mathcal{O}(2^n)\). This is commonly patched up with dynamic programming. Specifically, either the memoization: from functools import lru_cache @lru_cache(100) def memoized_fib(n): if n < 2: return n else: return memoized_fib(n-1) + memoiz... | |
| | | | |
128bit.io
|
|
| | | Over the past couple months, I've been working on fine tuning my Python skills, part of this has been taking tutorials online along with building some applications. One of the things I've been wanting to document, mostly for myself, is setting up a new environment for developing with Python. I'm using macOS Sierra right now, it seems that most operating systems still comes with version 2.x of Python. It's always a good idea to be able to control the version of Python you are using. | ||