time complexity - best option to sort edges in kruskal's algorithm? -
i'm implementing kruskal's algorithm , i'm not sure better way order edges. need best time complexity big inputs(300 000+ edges). know similar in time complexity, i'd know faster big inputs.
start using library-supplied sort function. solution working. might fast enough. if isn't, profile , decide whether it's sort or else that's causing slow-down. note, however, unless you're @ optimizing code, custom sort slower built-in version.
Comments
Post a Comment