Explore >> Select a destination


You are here

blog.demofox.org
| | www.oranlooney.com
6.7 parsecs away

Travel
| | 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...
| | www.rorvswild.com
6.8 parsecs away

Travel
| | So using Ruby, what is the largest Fibonacci number we can calculate quickly?
| | davidbau.com
5.2 parsecs away

Travel
| |
| | nickhar.wordpress.com
41.6 parsecs away

Travel
| The algorithm for probabilistically embedding metric spaces into trees has numerous theoretical applications. It is a key tool in the design of many approximation algorithms and online algorithms. Today we will illustrate the usefulness of these trees in designing an algorithm for the online Steiner tree problem. 1. Online Steiner Tree Let $latex {G=(V,E)}&fg=000000$ be...