问题:
Most people with a degree in CS will certainly know what Big O stands for . 大多数拥有CS学位的人肯定会知道Big O代表什么。 It helps us to measure how (in)efficient an algorithm really is and if you know in what category the problem you are trying to solve lays in you can figure out if it is still possible to squeeze out that little extra performance. 它可以帮助我们评估算法的效率(效率),如果您知道要解决的问题属于哪一类,则可以判断出是否仍有可能榨取少量的额外性能。 1 1个
But I'm curious, how do you calculate or approximate the complexity of your algorithms? 但是我很好奇, 您如何计算或估算算法的复杂性?
1but as they say, don't overdo it, premature optimization is the root of all evil , and optimization without a justified cause should deserve that name as well. 1,但是正如他们所说,不要过度使用, 过早的优化是万恶之源 ,而没有正当理由的优化也应该得到这个名字。
解决方案:
参考一: https://stackoom.com/question/qV/大O-您如何计算-近似参考二: https://oldbug.net/q/qV/Big-O-how-do-you-calculate-approximate-it
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4321735