6

"Thus, the total time for Prim's algorithm is O(V lg V + E lg V) = O(E lg V), which is asymptotically the same as for our implementation of Kruskal's algorithm."

From http://serverbob.3x.ro/IA/DDU0137.html

But why is O(V lg V + E lg V) = O(E lg V) ??

Is it because E is at least V-1 ?

2 Answers 2

3

Because in the normal case we assume that E is larger than V. So by ignoring the lower order terms we got E lg V

Sign up to request clarification or add additional context in comments.

Comments

1

Specifically, E can be a maximum of V^2 in a directed graph. If we assume E = v^2 (to account for worst case), E swallows V.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.