How to compute this greedy complexity

32 views Asked by At

Can anyone help me to compute this complexity?

What i think is :

Line 1 is an O(nlogn) for the sort.

Then,I have to compute for every node (line 2, while (U!=0) ) two stars for the node.

Compute one star for all nodes its cost O(|E|), but my problem is the second star.

Can anyone help me?

0

There are 0 answers