/explore
|
You are here |
www.rorvswild.com | ||
| | | | |
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... |
|
| | | | | ||
| | | | |
cp-algorithms.com
The goal of this project is to translate the wonderful resource http://e-maxx.ru/algo which provides descriptions of many algorithms and data structures especially popular in field of competitive programming. Moreover we want to improve the collected knowledge by extending the articles and adding new articles to the collection. |
|
| | | | | ||
| | | | |
kevinventullo.com
Suppose you knew that 9,273,284,218,074,431 was a perfect 7th power. How would you compute the 7th root? This is a long overdue sequel to the previous post, in which the author promised to derive an efficient algorithm for computing exact k-th roots of integers. That is, computing the k-th root of an integer assumed to... |
|
| | | | | ||
| | | | |
brunoscheufler.com
JSON Web Tokens are a popular way of managing authorization and authentication policies for web applications. Sending around a base64-encoded token that can be verified by every service using it, enables uncomplicated (and stateless) application design compared to other mechanisms.... |
|
| | | |||