Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果算法具有时间复杂度O(n+m),并且我们知道m >= n(例如,我们正在遍历具有n节点和m边的连通图)。那么我认为以下是正确的:
O(n+m)
m >= n
n
m
O(n+m) = O(m)
O(n log n + m)
这个对吗?
是的。要消除其中一个术语,您必须更多地了解 n / m。