两种不同操作的算法运行时间

slo*_*kar 2 algorithm big-o

我有一个包含两个操作的算法.第一操作运行时间为O(n),第二操作的运行时间为O(log n).在这种情况下,完整算法的运行时间是多少?它会是O(n)还是O(n)+ O(log n)?

Fit*_*itz 7

O(n + log(n)) = O(n)

你的时间复杂度将是O(n)

http://en.wikipedia.org/wiki/Big_O_notation