3 ms·
This is something you need to know! What approach you use most definitely needs to keep in mind it's runtime. O(n^2) must be looked at with a skeptical eye an
by LorenPechtel 7y ago
This is something you need to know! What approach you use most definitely needs to keep in mind it's runtime. O(n^2) must be looked at with a skeptical eye and you better be sure there's no better answer when going higher. (I've hit O(n^8) in production code in a data verification routine and O(2^n) in a side project--the latter had to be scrapped in favor of an O(n^2) that wasn't guaranteed to find the best answer.)