Suppose I want to deploy the algorithm for finding connected components in a graph $k$ many times. Now the time complexity for finding connected components in an undirected graph is $O(v+e)$. Then what will be the time complexity, $O(k(v+e))$ or $O(ke)$?
Similarly, I have deployed a method $k$ times which requires $O(n^2+n^2)$. What will be its complexity, $O(kn^2)$ or $O(k(n^2+n^2))$?