|
I'll have to check on the O(e^n) code. I remember crossing that once and it's probably more complicated than most here will understand -- I'll PM you when I find it, but I'm drunk tonight so O(e^n) stuff would be outside my brain's capacity right now.
If it were a syntax error that he was experiencing, then it wouldn't work for short URLs.... It will be interesting to see the function, however, as we could then discuss it's Big-O equivalence. As a bit of a side note, I see nothing in the original post which suggests a linear calculation -- am I missing something? What suggested to me that there was an issue with calculational complexity is that with a short URL (as provided) it worked in a short time but with a moderate URL (as provided) it didn't. That screams calculational complexity to me.
For those others who may be reading, not all Big-O stuff is related to one variable. Having O(m*n) is just as possible as well where m != n. There could be more than one variable affecting the overall complexity. Also, Big-O simplifies things down substantially. For example, if the calculated complexity was 3m*n^2 + 500n + 4000000, then the Big-O notation would only be O (n^2) as the other values are irrelevant as n->infinity (unless, m->infinity and n does not). [Now, I might be a bit wrong there as the alcohol has clearly set in and then the Big-O notation would be O(m*n^2) where m or n approaches infinity, but again, that depends on the nature of the issue involved.] The true key, however, is "how your stucture processes the items in your structure."
Oh, I guess I should add that the problem may only be O(n), but the function may be poorly written and be O(n^3). That would be something we would, most likely, be able to help correct.
__________________
Jeremy Miller
Please login or register to view this content. Registration is FREE
Last edited by JeremyMiller; 02-04-2008 at 02:28 AM..
|