4 ms·
memoization is a common use case. If you are doing an expensive computation that gives the same answer for the the same inputs, you can build a lookup table for
by comnetxr 8y ago
memoization is a common use case. If you are doing an expensive computation that gives the same answer for the the same inputs, you can build a lookup table for cases you have already encountered to avoid recomputing. you can use an object to encapsulate the inputs (or the inputs might be objects already).