time complexity of prim's and kruskal algorithm code example Example: kruskal algorithm time complexity Time complexity:- O(ElogV)