3 ms·
This is a reasonable solution. While it will (almost) never provide the correct result (it might print out a cycle of comments until X is reached, or it might c
by timothya 14y ago
This is a reasonable solution. While it will (almost) never provide the correct result (it might print out a cycle of comments until X is reached, or it might cut off a very long but legitimate comment thread), it would provide a reasonable guarantee on this sort of problem not generating infinite pages.
- petercooper 14y agoAt the risk of being accused of flame-baiting, I'd say it's the engineering solution rather than the mathematical one.. ;-) For some reason I tend to be a fan of the "stick it in a secure box" rather than "get it right in the first place" approach..