I just read this and found it interesting. I'm intrigued by the O(n²) challenge of a loop running inside a loop and how to optimize it. One suggestion, which will NOT fit every case, may be to break that which is being crawled up into chunks. If there are sixteen items to crawl and sixteen squared is two hundred fifty-six, then if we broke the sixteen up into four fours and four squared is just sixteen again and sixteen times four is just sixty-four, then we are starting off in a better place than with two hundred fifty-six. When we cross-compare our four chunks I guess we have to do it wisely, but hopefully the optimization keeps us from climbing as high as two-hundred fifty-six, etc.
No comments:
Post a Comment