sort the edges of G in ascending order in queue Qedges while |EMST | < (n − 1) do pop the first edge e from Qedges if EMST [ {e} does not lead to a cycle then EMST = EMST [ {e} end if end while Complexity: O(|E| log |V |) V...setofvertices, E...setofedges
sort the edges of G in ascending order in queue Qedgeswhile |EMST | < (n − 1) dopop the first edge e from Qedgesif EMST [ {e} does not lead to a cycle thenEMST = EMST [ {e}end ifend whileComplexity: O(|E| log |V |) V...setofvertices, E...setofedges