@MISC{_•union-find, author = {}, title = {• Union-Find • Sorting}, year = {} }
Share
OpenURL
Abstract
• There are positive constants c and n0 such that f(N) <=c g(N) when N> = n0 • The growth rate of f(N) is less than or equal to the growth rate of g(N) • g(N) is an upper bound on f(N) • Example – Let f(N) = 2N2. Then • f(N) = O(N4) • f(N) = O(N3) • f(N) = O(N2) (best answer, asymptotically tight) • For loops – at most the running time of the statements inside the for-loop (including tests) times the number of iterations. • Nested for loops – the running time of the statement multiplied by the product of the sizes of all the for-loops – O(N2) • Consecutive for loops – These just add – O(N) + O(N2) = O(N2)