Can you tell what is wrong with my code ? The Runtime error only occures if I manage to memoize the cut cost value (i.e calling vMemoize() function). I just simply don't get it, why should I rewrite the algorithm itself, if it works ?
#include "stdio.h" #include "stdlib.h" #define NA -1 typedef struct { int iFromIndex; int iToIndex; int iCost; } stCutCost; int iNumberOfCuts; // The number of cuts to be done int iLength; // The overall length of the stick int *iCuts; // The array that holds the cut markers (le...
Hello everyone! I've composed a program using algorithm from "algorithmist" (recursion. Although, I got this solution by myself, without peeking), but without memoization. For my submission I've received: Time Limit Exceeded , which could be kinda obvious (because some say - the test input...