Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Memoization and dynamic programming come together in top down DP algorithms. These are also referred to as recursion with memoization. The recursive function often looks something like:

    f(arguments) {
        results = memoTable[arguments]

        if(results) // use results
        else
            results = // expensive recursive call to f
            memoTable[arguments] = results
    }


As far as I have understood, this is just regular memoization. I mean, often in functional languages one just turns a regular function into a memoized version by calling memoize(function). Sometimes that works to create a function that does what your code does, and sometimes it does not. When it does not I think that's a shortcoming of the language/implementation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: