Advanced | Help | Encyclopedia
Directory


Topcoder-Samp

Standard code:

int bestSum(int pos, int numPlus) {
    // do brute force stuff
    return val;
}

with memoization

int memo[1000][1000];
int bestSum(int pos, int numPlus) {
    if(memo[pos][numPlus]!=0) return memo[pos][numPlus];
    // do brute force stuff
    memo[pos][numPlus]=val;
    return val;
}







Links: Addme | Keyword Research | Paid Inclusion | Femail | Software | Completive Intelligence

Add URL | About Slider | FREE Slider Toolbar - Simply Amazing
Copyright © 2000-2008 Slider.com. All rights reserved.
Content is distributed under the GNU Free Documentation License.